session problem when i click logout it redirect to logout.aspx
but when i click backward button it remain goes to to logout page
how to solve this
this is my code for logut
protected void Page_Load(object sender, EventArgs e)
{
Session.Abandon();
Session.Clear();
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);
FormsAuthentication.SignOut();
Response.AddHeader("Refresh", Convert.ToString((Session.Timeout * 5) - 120));
Response.Redirect("login.aspx");
}

Sunny SharmaRank #223 · 11.1K reputationPosted Jan 24, 2014, 12:14 AM EST
try this code inside your Page_Load() block of logout page:
***********************************************
Session.Abandon();
Session.Clear();
FormsAuthentication.SignOut();
Response.ExpiresAbsolute=DateTime.Now.AddDays(-1d);
Response.Expires =-2000;
Response.CacheControl = "no-cache";
//Response.AddHeader("Refresh", Convert.ToString((Session.Timeout * 5) - 120));
//why to wait 5 minutes after logout, just redirect to login page.
Response.Redirect("login.aspx");
***********************************************
Hope it helps!
muthukumar146 reputationPosted Jan 24, 2014, 12:33 AM EST
but my problem is when i click backward button in browser it goes to logout.aspx
(i.e) <---- this in google chrome it once again goto logout page
after logout when click backward it should not got to logout.aspx from login.aspx
Shridhar Joshi11 reputationPosted Jan 24, 2014, 12:47 AM EST
Try to disable backbutton of browse for login page using java script like this
<SCRIPTtype="text/javascript">window.history.forward();function noBack() { window.history.forward(); }SCRIPT>HEAD><BODYonload="noBack();"onpageshow="if (event.persisted) noBack();"onunload="">
All the best
muthukumar146 reputationPosted Jan 24, 2014, 1:05 AM EST
Shridhar Joshi11 reputationPosted Jan 24, 2014, 1:24 AM EST
http://www.codeproject.com/Tips/632336/Disabling-browsers-back-button
Biswa Pujarini MohapatraRank #465 · 5.4K reputationPosted Jan 24, 2014, 1:32 AM EST
http://smewara.wordpress.com/2013/01/31/browser-back-button-issue-after-logout/
Sunny SharmaRank #223 · 11.1K reputationPosted Jan 24, 2014, 2:03 AM EST
If it's a page, are you checking if the user is authenticated in Page_Load of logout.aspx?