wood burning stoves 2.0*
The moose likes JSP and the fly likes disable back button when logout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "disable back button when logout" Watch "disable back button when logout" New topic
Author

disable back button when logout

pradip thite
Greenhorn

Joined: Apr 19, 2014
Posts: 9


Hi,

I have a website which requires login. After I enter username and password and click login button, a new page is loaded. In that page I have a username in the right up corner. When the user clicks logout button, Session.Clear() method is called and also Response.Redirect(" to login page "). It works OK, but the problem appears when I then click Back button in the browser. It gets me back to previous page with the username in the right up corner. Insted, I would like to show message asking user to enter password again so he can login properly.

If anyone knows how...

can any one tell me what should i do at client side???
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

This has been disucess many times. You can't. And even more important, you shouldn't. Please read InterfaceDesignersRule1

Rather, you should properly be controlling the caching of your pages and structuring your web app security correctly. Search the forums for previous discussions.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
phooton misra
Ranch Hand

Joined: Jul 31, 2012
Posts: 40

better you should invalidate the session by calling session invalidate method on clicking logout button.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Invalidating the session will have no effect on the cache.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: disable back button when logout
 
Similar Threads
Login/logout Problem
How to remove JSESSIONID cookie on session invalidation
which Struts tag?
I need help on developing login/logout application using struts2 frame work
Login/Logout Problem