Click here to Skip to main content
15,040,743 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I place Logout button in my web form. The user clicks the logout button that sends him to the login page. I'm using code like:

C#
Session["username"] == null;
Session.Abandon();
Response.Redirect("login.aspx");


In this code I Redirect to the login page, but my problem is when I click the back arrow button of the browser it goes to the previous pages.

Please give a solution for only displaying a login page after clicking the logout button when i click the back arrow button of browser, and not going to any another pages.

Thanks.
Posted
Updated 24-May-10 3:09am
v3

Why don't you guys search the forum before posting?... we have replied this number of times...
You need to reset history of browser!
http://www.codeproject.com/Answers/82150/Clear-browser-history.aspx#answer1[^]
   
Use the following code to expire the cache of the browser when the user logs out
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now);


Fro browser other the IE you can use
Response.Cache.SetNoStore();


For more details check
http://geekswithblogs.net/vivek/archive/2007/02/24/107148.aspx[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900