• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Logout servlet problem with back button  RSS feed

 
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • 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
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
I am not supposed to use filter
 
Ranch Hand
Posts: 85
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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 Java Spring
  • Mark post as helpful
  • send pies
  • 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
 
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!