Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

disable back button when logout

 
pradip thite
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
phooton misra
Ranch Hand
Posts: 52
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
better you should invalidate the session by calling session invalidate method on clicking logout button.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Invalidating the session will have no effect on the cache.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic