I need to know how to clear session on Logout in MVC 4
asp.net
I have tried almost every thing but all in vain.
[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();
Clear cookies
set session to Null on Logout etc
but when i click on Browser's back button . it redirect to the same account. please help me , how would i clear session variable when i click on logout button. I tried each of the above one by one and then in group but same result.