• 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

how to prevent user browse back to previous page after sign out!  RSS feed

 
Ranch Hand
Posts: 35
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone,

How to prevent user from visting back using browser "go back button" after signout, I have tried



it did show an page expired page when user trying to go back, however, even when user stay logged in, user will get the "page expire" when using the go back button.

Can anyone give me some clue how to prevent user from goint back to previous page (ideally redirect to login page) after sign out, while user can freely go back to previous page while logined in.


Thanks
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, make sure your dynamic pages have no cache headers or your browser will return an in-memory copy of the previous page when the back button is clicked.
See:
http://faq.javaranch.com/java/NoCacheHeaders

Then, to insure that they don't back click themselves all the way to the original login, use the post-redirect-get pattern to make sure that the first page of your app is returned from a get request, not the actual login post.
See:
http://faq.javaranch.com/java/PostRedirectGet

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!