你只是把Session赋值为null,但当前会话并没有消除!所以你后退还是会进入退出前的页面!!
你要是那样写的话,在每个页面的Page_Load方法中都判断一下Session["Admin"] 是否为空,为空则Response.Redirect("../Login.aspx")。
退出系统时,应该销毁Session:Session.Abandon();
设置页面不被缓存
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
HttpContext.Current.Response.Expires = 0;
HttpContext.Current.Response.CacheControl = "no-cache";
HttpContext.Current.Response.AddHeader("Pragma", "No-Cache");
REF:
使用SCheduler控件实现生产进度监控程序