Logout In Java (JSP/SERVLET)
how to disable back button of the browser after logout?
Many Problems & questions I found when related to logout/signout .After signout/logout the browser
Back button is working and a user can go inside or previous page without again login.Once you logout/signout ,i.e. you cannot go to your working page without once again new login.But , there was
a problem after Logout/Signout the Back button is working.To avoid this for implementing proper logout/signout I solve this....
1. set the Session to Null (Do not invalidate the session if the jsp use other session including Login)
2. Set the necessary Header to Every Jsp having Logout/Signout Link
//Forces caches to obtain a new copy of the page from the origin server
//Directs caches not to store the page under any circumstance
//Causes the proxy cache to see the page as "state"
//HTTP 1.0 backward compatibility
3. Check the session (Username) in jsp ,if null the redirect to Login Page.
//Do normal }
Now it will work . Enjoy and Follow Me.