我想問一下關於註銷後失去了本屆會議:會議在ASP.Net(C#)在Firefox和Chrome
我寫的代碼,但它僅在Internet Explorer中的工作,而不是在Mozilla Firefox或谷歌鉻。在這兩種瀏覽器中,如果我點擊後退按鈕進行註銷,則會返回用戶的帳戶。
註銷頁面代碼(在頁面加載) -
FormsAuthentication.SignOut();
Session.Abandon();
Session["CustomerId"] = null;
FormsAuthentication.RedirectToLoginPage();
在其他每一頁或主PAGE-
Response.Cache.SetCacheability(HttpCacheability.NoCache);
if (Session["CustomerId"] == null)
{
Response.Redirect("~/Login.aspx");
}
在web的配置文件 -
<authentication mode="Forms">
<forms name="MyCookie" loginUrl="Login.aspx" protection="All" timeout="90" slidingExpiration="true"></forms>
</authentication>
但是你還在登錄嗎?如果你點擊後退按鈕,瀏覽器可能會返回一個緩存頁面。如果您嘗試使用Ctrl + F5重新加載頁面,您是否仍然登錄? – sirrocco 2012-04-26 10:45:38