This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSF and the fly likes How to Stop user going back after logout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » JSF
Bookmark "How to Stop user going back after logout" Watch "How to Stop user going back after logout" New topic

How to Stop user going back after logout

Hemant Gupta Hg

Joined: Jan 23, 2011
Posts: 11

Can anyone please tell me how to stop the user from visiting the previous pages after the user has logged out? I am using JSF and I have applied filters to prevent access to secure pages but after logging out I can see the previous visited pages.

I know this is the problem with browser cache but there must be some way as Google and every other website does prevent going back.

Please help me out guys.

Hany Shafik
Ranch Hand

Joined: Jun 21, 2008
Posts: 80
What the user is viewing is from the cache you can prevent caching by adding
<meta HTTP-EQUIV="Pragma" content="no-cache"> and
<meta HTTP-EQUIV="Expires" content="-1">
this will cause the browser to issue new request to your server and since you have filter to protect your pages it should forward the user to the login form
Have you checked out Aspose?
subject: How to Stop user going back after logout
jQuery in Action, 3rd edition