i am working on a asp.net(with c#) web application and here i have problem.
That i have a customer page(customer.aspx) and in this page a user can fill it's information & user can also update if it's already a regsitered user.
So whenver this page loads i check that a user is logged in or not using a session variable and if that session variable is set then user can update his/her information and here is the code of checking at customer.aspx
protected void Page_Load(object sender, EventArgs e)
{
if (Session["customerID"] != null)
{
//here is my code
}
}
but the issue is if my user click on logout then all goes fine but if user just press the back button of my browser(IE 7.0) then user is allowded to update his/her infomation and this should not happen. So please tell me solution for this problem.
my logout.aspx code is here :
protected void Page_Load(object sender, EventArgs e)
{
Session.Clear();
Session.RemoveAll();
Session.Abandon();
Response.Redirect("login.aspx");
}
so please suggest me solution for this issue.
Clear the Cache
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();