Click here to Skip to main content
16,019,263 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i restrict user from accessing any secure page after he/she logged out from the web application? How the back button of the browser can be made disable so that after user logged out he/she can't enter the previous page by clicking back button?
i have tried javascript 'window.history.forward(0), it works in firefox but not in opera!! How can i clear the cache/history of the browser?? Any other method which can work in all browsers?? Please tell me...
Posted

This is a wrong approach. APS.NET application does not have access to a Browser and should not attempt it. If this is possible for some Browser using a client-side script, some other Browser does not have to follow this rule.

Rather, the Web site status model should be tolerant to any user's navigation. In worse case, the page is considered in the invalid state, so some controls on the page are disabled. Not so about the controls of the Browser itself — the Web application never touchs them and never assumes anything about them. This is how decent authentication-based sites work.

—SA
 
Share this answer
 
Comments
Kaiiser 18-Apr-11 4:52am    
nice info ..you got my 5...
Sergey Alexandrovich Kryukov 18-Apr-11 4:58am    
Thank you.
--SA
I second SAKryukov.

For your information, look at this Tip/Trick.

Browser back button issue after logout[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 18-Apr-11 5:08am    
Very good reference and Sandeep's work, my 5. It shows that I was not quite right as controlling cache is a legitimate way.
--SA

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