• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!