File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Expiring session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Expiring session" Watch "Expiring session" New topic
Author

Expiring session

Ganesh Gawande
Greenhorn

Joined: Nov 06, 2008
Posts: 5
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30293
    
150

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)


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

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


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
You should not change the client environment and the default user experience. Period.

Just code your application well.
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
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.


Thanks and Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Expiring session