1. 程式人生 > >退出登入,清除Session

退出登入,清除Session

{
3InBlock.gifif(Session["UserName"]!=null)
4ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
5InBlock.gifSession.Remove("UserName");
6InBlock.gifSession.RemoveAll();
7InBlock.gifResponse.Cookies["UserName"].Expires=DateTime.Now;
8ExpandedSubBlockEnd.gif}
9InBlock.gifPage.RegisterStartupScript("","<script>window.top.document.location.href='index.aspx';</script>");
10ExpandedBlockEnd.gif}