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


when i Click on logout button in my .net application and then when i press back button key in browser i will be autometically sign in ...
i need solution for it...
Generally Website should ask username and password.

Posted
Updated 28-May-12 0:41am
v2
Comments
bbirajdar 28-May-12 9:14am    
Its not the security weakness friend.Its the issue with your implementation.

refer the following url, where Sandeep Mewara has posted Tip for such issue.:
Browser back button issue after logout[^]

hope it helps.
 
Share this answer
 
v2
Comments
Sandeep Mewara 28-May-12 8:29am    
5! :)
member60 29-May-12 1:33am    
thank you sandeep !
You will need to make sure the pages behind the login (those that can only be accessed after login) are not cached in the browser:
C#
Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);

If using forms authentication, you will also need to abandon the session and logout:
C#
Session.Abandon();
FormsAuthentication.SignOut();


Browser back button[^]
Disable back button[^]

Please refer a good answer on same question:
How to disable browser back bottun after logout.[^]

Another solved answer:
After Logout Their is Back Button Problem[^]

Some more useful links:
Back Button issue after Logout in ASP.NET[^]
How to disable back button of the browser after logout[^]
 
Share this answer
 
on clicking of logout button remove all the sessions (Session.Abandon()). and on every page check a particular session (create a common functiion) if it is null than redirect to your default error page.

and i give u link k hope it will more help

ASP.NET web application security review: Do's & Don'ts[^]
 
Share this answer
 
Can't miss an opportunity to post my link as well!

Web Development - Disabling the back button[^]
 
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