• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Expiring session

 
Ganesh Gawande
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please Can any1 help me for...
deactivation of back button of browser ....when I click signout...in my JSP page...

or session should expire when I clicked back Button of browser...

Its my kind request...I am not getting solution for this...

Please...

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34229
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ganesh,
You cannot disable the back button.

You can set all pages to no-cache and then not repaint them if the session is invalid (after the user signed out)
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found a trick to disable the back button somewhere some time ago. But it was a very bad trick but still I would like to mention it. In that you open the new page in a new window or tab and then close the current tab or window using javascript. I know this is very weird but well it is a solution
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should not change the client environment and the default user experience. Period.

Just code your application well.
 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can consider, disabling the caching of a page in the browser. For doing so, see this: http://www.coderanch.com/t/414250/JSP/java/back-button#1826301
Once this is done, any back button would result in the page being fetched from the server, and in the server you can handle your requirement, like invalidating the session(if it exists) and creating a new one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic