I'm creating a website in ASP.NET (Framework 4.0). I have maintained session in this website. I have written code for logout where FormsAuthentication , session value is Abandon . My Code as follow for logout button click .
protected void LinkButton1_Click(object sender, EventArgs e)
{
if (Request.Cookies["ASP.NET_SessionId"] != null)
{
Response.Cookies["ASP.NET_SessionId"].Value = string.Empty;
Response.Cookies["ASP.NET_SessionId"].Expires = DateTime.Now.AddMonths(-20);
}
FormsAuthentication.SignOut();
Session.Abandon();
Response.Redirect(FormsAuthentication.DefaultUrl);
}
How to disable / block /prevent to previous page when logged out & without javascript. Because when user gets logout ,he redirect to default page, but users click browser back button he redirects to previous page (i.e users home page ) instead of login page.