• 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 servlet problem with back button

 
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using logout and invalidating in servlet code is


but when i click the back button it is going to previously visited page..
Please help me...
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, implement the filter which looks for the active session whenever some one tries to access the user pages, in that case even if browser goes to last page after logout using back button, the user can't do anything as he/she will be redirected to login page.

To directly answer your question:
disable back button after logout

One clean Code note:
HttpSession ls = request.getSession(false);
'ls' doesn't sound good for session variable name, may be, umm, you can use more intrigued one, like "session"
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not supposed to use filter
 
Ranch Hand
Posts: 85
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

test with adding this also.
add some previous date to that date argument. if you can add listener you can solve this issue easily .
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks it works but i added some java script to reload the page in body tag. it reload the page and solve my back button issue.
this is code


but it still displaying the previous user login name.please help me
 
pradeep gamage
Ranch Hand
Posts: 85
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I understand now your issue is when user logout in login page user name text feild display user name. if it problem you have to reset user name text feild when you redirect page.
if log out works fine. then you don't want reset login form feilds
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic