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

logout when click on the back button on browser

Narasimha Reddy
Greenhorn

Joined: Oct 05, 2004
Posts: 11
Hi,
How to invalidate the session when the user clicks back button on the
browser.I know HttpSession.invalidate() method is there.But how to invoke that method when the user clicks back button of the browser.

Thanks for ur respose in advance.

Thanks&Regards,
Narasimha Reddy
SCJP1.4


Narasimha Reddy
Sravan Kumar
Ranch Hand

Joined: Sep 11, 2005
Posts: 121
Why do you want to invalidate a session on the click of back button?

I hope you have a button or link in your web-app that the user has to press when he wants to logout. Track this action to the server side and call invalidate() explicitly. You would not have to worry about the back button then.


keep smilin :: sravan<br /><a href="http://sravanpens.blogspot.com" target="_blank" rel="nofollow">I scribble here</a>
Narasimha Reddy
Greenhorn

Joined: Oct 05, 2004
Posts: 11
Hi sravan,
thanks for ur response.
It is possible to expire the session when clicking on back button of browser.If posible please give the instructions how to handle that one.

Thanks&Regards,
Narasimha Reddy
SCJP1.4
Gaurav Chhabras
Ranch Hand

Joined: Sep 21, 2005
Posts: 126
when the user clicks the BACK button then take that to other page and check whether BACK button is pressed or not.
If yes then call the invalidate() function and you will win the arena.

Best of Luck.
Gaurav
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: logout when click on the back button on browser