This week's giveaway is in the Java/Jakarta EE forum. We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line! See and I assume that you dont want the user to move back and do any more editing in your web application...so again, are you are validating the authority of the user everytime you traverse through your pages?... if yes.. just go to the exception page (or login page) if the user is trying to go back after logout using a listener or an action.
Time is what we want the most, but what we use the worst. -- William Penn
This problem, has got nothing to do with sessions, its the problem with browser caching the page, when user clicks back, browser is showing you a cached page. So declare no-cache as true in JSP. I assume that, you are doing session.invalidate() after, once user clicks logout. If not, first destroy/invalidate the session..
Deepakkumar Devarajan wrote:Use window.history.forward(1); in your script, whenever you click button, you will be redirected to the current page. Hope this helps
Hi there ,
I had the same problem , so I have used your code in logout.jsp page like this .
Is this the right way to do this ?
When I click on button , the page goes to index.jsp and when I click the back button, it does not go back to logout.jsp page. That is what I want. However , I want to make sure that this is done the RIGHT WAY.