Hi,
I want to prevent the user from viewing the previous page using the Back
button after logout. I want to instead show that this page has expired.
How do I do this?
Here is my codebehind on the logoff page.
private void Page_Load(object sender, System.EventArgs e)
{
Session.Abandon();
FormsAuthentication.SignOut();
Response.Redirect("index.aspx");
}
I tried the following and none of them worked.
1. Added a no-cache meta tag.
2. Tried including the following code in page-load of logout.
Response.Clear();
Response.BufferOutput = true;
Response.Cache.SetExpires(DateTime.Now);
Response.Cache.SetCacheability(HttpCacheability.No Cache);
Response.Cache.SetNoStore();
Response.Write("");
Response.End();
What am I missing or doing wrong?
Regards,
Anand