after logout if i click the back button i want to remain in the login page.... but this code wont work when i click back button it will redirect to the previous page. can some help me.
public virtual ActionResult Logout()
{
FormsAuth.SignOut();
ActionResult homeAction = MVC.Account.Login();
string logoffUrl = Url.Action(homeAction);
string[] myCookies = Request.Cookies.AllKeys;
foreach (string cookie in myCookies)
{
Request.Cookies[cookie].Expires = DateTime.Now.AddDays(-1);
Response.Cookies[cookie].Expires = DateTime.Now.AddDays(-1);
Response.Cookies.Add(Response.Cookies[cookie]);
Request.Cookies.Add(Request.Cookies[cookie]);
}
HttpContext.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
HttpContext.Response.Cache.SetValidUntilExpires(false);
HttpContext.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Response.Cache.SetNoStore();
return RedirectToAction(homeAction);
}
}