我有一个使用表单例份验证的 ASP.NET 应用程序。当用户单击页面上的“注销”按钮时,它将运行以下代码。
FormsAuthentication.SignOut();
Response.Expires = 0;
Response.Cache.SetNoStore();
Response.AppendHeader("Pragma", "no-cache");
但是,用户仍然可以只需按后退箭头即可查看上一页,而无需再次登录。我确信这与缓存的前一页有关。我如何确保他们在返回时系统会提示重新登录?
最佳答案
Response.Cache.SetCacheability(HttpCacheability.NoCache);
关于asp.net - 退出后返回箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/579359/