I am having below code for logout. when It gets log out but when back is pressed it should not go to previously visited page but it does.
//when login
if (txtPassword.Text == password)
{
Session["Login"] = true;
Response.Redirect("AdminControlPanel.aspx");
}
//when logout
Session["Login"] = false;
Session.Abandon();
FormsAuthentication.SignOut();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);
Response.Redirect("~/index.aspx");
//checking on adminpanel.aspx
if (!this.Page.IsPostBack)
{
if (this.Session["Login"]==null || (bool)this.Session["Login"]==false)
{
base.Response.Redirect("~/index.aspx");
}
}
what is wrong with this?