我需要知道如何清除會話註銷MVC 4
asp.net
我已經嘗試了幾乎所有的東西,但都是徒勞的。註銷MVC清除會話4
[AllowAnonymous]
public ActionResult SignOut()
{
Response.AddHeader("Cache-Control", "no-cache, no-store,must-revalidate");
Response.AddHeader("Pragma", "no-cache");
Response.AddHeader("Expires", "0");
Session.Abandon();
Session.Clear();
Response.Cookies.Clear();
Session.RemoveAll();
Session["Login"] = null;
return RedirectToAction("Index", "Login");
}
Session.Clear();
Session.Abandon();
清除餅乾
組會議爲NULL,註銷等
,但是當我點擊瀏覽器的後退按鈕。它重定向到相同的帳戶。 請幫助我,當我點擊註銷按鈕時,我將如何清除會話變量。 我嘗試了上述的每一個,然後在組中,但結果相同。
請多指點一下..認證類型,cookie類型?你可以檢查你是否清除了所有的cookies?您可以使用瀏覽器檢查器檢查。 –
告訴您登錄索引操作 –