• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

logout when click on the back button on browser

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Narasimha Reddy
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic