hi
in my project when i click on logout anchor it goes to logout page and my code in logout page is
if (Session["user_id"] != null)
{
Session["user_id"] = null;
Session.Abandon();
Response.Clear();
FormsAuthentication.SignOut();
Response.Redirect("login.aspx");
}
it properly logout and goes to login.aspx but problem is login.aspx when i click browser back button it goes me again on last page where i click on logout anchor.
please any body know solution of this please reply me
Loading

Scott LysleRank #49 · 31K reputationPosted Aug 18, 2008, 2:22 AM EDT
When the user logs out, try expiring the cache:
Response.Cache.SetExpires(DateTime.Now)
Response.Cache.SetCacheability(HttpCacheability.Private)
Scott LysleRank #49 · 31K reputationPosted Aug 18, 2008, 2:22 AM EDT
When the user logs out, try expiring the cache:
Response.Cache.SetExpires(DateTime.Now)
Response.Cache.SetCacheability(HttpCacheability.Private)
shahid13 reputationPosted Aug 19, 2008, 9:43 AM EDT
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Aug 19, 2008, 3:43 PM EDT
Add the following code in page behind of log out page.
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
string sb;
sb = "";
Page.RegisterClientScriptBlock("clientScript", sb);
}