I am using ASP.NET and C#.After click logout i am using this.
Session.Abandon();
Session.RemoveAll();
Page.Responce.Cache.setCacheability(HttpCacheability.NoCache);
Response.Redirect("Default.aspx");
But after this if they clicked back button in browser it is going to previous page.
Is there any way to prevent this?
Thanks..
Edit:
I did used this.
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
if (Session["LoginId"] == null)
Response.Redirect("frmLogin.aspx");
else
{
Response.ClearHeaders();
Response.AddHeader("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate");
Response.AddHeader("Pragma", "no-cache");
}
}
}
Because of this they click browser back button then the pageload will be called so there we can check for the session variable for authentication.
I am posting a link I hope this guide you and Help you whatever you need click here
http://www.dotnetfunda.com/