请问session退出,在asp中怎么写代码?
以下是清除session的代码,但是在ASP中不知该怎么用,请各位大虾指点!protected void Button1_Click(object sender, EventArgs e)
{
if (Session["UserName"] != null)
{
Session.Remove("UserName");
Session.RemoveAll();
Response.Cookies["UserName"].Expires = DateTime.Now;
}
Page.RegisterStartupScript("","<script>window.top.document.location.href='index.aspx';</script>");
谢谢啊!

