Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.22/5 (2 votes)
See more:
I am new to this and I'm creating web page in asp.NET with c#. In that page, after user logs out, they are still able to use the BACK button and are able to read-only the information. I cannot figure out how to get rid of this Back button issue. I want my wenpage to exhibit the same behavior that Yahoo! Mail exibits: after you sign out, you are not able to go back (even by using the Back button in the browser), without signing back in. Any help would be REALLY appreciated!!! Thanks!
Posted
Comments
Sergey Alexandrovich Kryukov 20-Mar-13 9:36am    
Please stop posting non-answers as "solution". It can give you abuse reports which eventually may lead to cancellation of your CodeProject membership.
Comment on any posts, reply to available comments, or use "Improve question" (above).
Also, keep in mind that members only get notifications on the post sent in reply to there posts.
—SA

Try This :

Add this on your Home page on which loh out is thre.

Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
Response.Expires = -1500;
Response.CacheControl = "no-cache";
Response.Cache.SetNoStore();



this may help you, if not then please post it.
 
Share this answer
 
you can do it by the session when you log out make session cleare
 
Share this answer
 
pass parameter values 1 and -1 i don't exectly remember what value was this will block back functionality
second point on logout must use Session.Abondon(); or Session["UserProfile"] == null and check on your pages if Session["UserProfile"] == null; Response.Redirect("~/Login.aspx");

JavaScript
<script language="javascript" type="text/javascript">
    window.history.forward(1);
</script></script>
 
Share this answer
 

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