• 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

log-out problem

 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a jsp page that has code as mentioned below:

if(session!=null){
session.invalidate();
}

I am able to get out of the login page and able to show a page that mentions the user that the user is logged-out. But when I click on the browser back button the previous page opens. How can I stop this?

Thanks
 
Srinivasa Kadiyala
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pl refer to the following link for the logic I implemented:

https://coderanch.com/t/361270/Servlets/java/Sign-Out-Function

Thanks
 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Why don't you use meta data tag no cache, after you logout and when you click the back button what you see is the page that comes fom the cache rather than new request. if you have no cache on, it will request for the same page as if it was a new request, on each page you can check if the session is active else redirect him to the login page.
Try it out and let me know.

Regards
Makarand Parab
 
reply
    Bookmark Topic Watch Topic
  • New Topic