jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes Sessions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sessions" Watch "Sessions" New topic


Sandeep Jain
Ranch Hand

Joined: Oct 25, 2000
Posts: 124
Hello friends ,
I have to implement session handling. What my doubt is ,I want the session to expire when the user click the back button on the browser.
How do I go for it . Please help

Try and Try Till u succeed<br /> <br />Sandeep Jain
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
This is really more a question for the Servlets/JSP forum, so I've moved it.

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog

Joined: Nov 10, 2000
Posts: 2
Your question is not clear,may be from whatever i got after reading I think this can be done using some method like invalidate() in HttpSesion Class or try using removeAttribute() or removeValue().
Paul Wetzel
Ranch Hand

Joined: Nov 02, 1999
Posts: 107
Here is what I think...You dont ever know when the browsers back button is pressed so I dont think you can accomplish your goal that way. You may want to track the users navigation of the site in the session and once he visits a page you can check the session to see if he has visited it. If he has then you can do whatever it is you want to do (invalidate the session).
best of luck
ash raj

Joined: Nov 07, 2000
Posts: 5

your question is not clear
as far as i know u can use the method HttpSession.invalidate()
to invalidate a session
else use HttpSession.removeValue(String st) - to remove objects bound to a specified name
I agree. Here's the link: http://aspose.com/file-tools
subject: Sessions
It's not a secret anymore!