Reputation: 11
i am new to jsp. I want to write a code for session login.Suppose anyone logs in & then logs out,it's ok!But if he press the BACK button ,he should not be directed to that page again.Instead he should get an error.Please send me the code for it!
Upvotes: 0
Views: 1120
Reputation: 1
For that you should use Java filter which redirects to a page or give an error page if session==null
Upvotes: 0
Reputation: 16105
Force browser to invoke the server rather than the cached page in the memory. You need to use the following code in jsp:
response.setHeader("Cache-Control", "no-cache"); response.setHeader("Pragma", "no-cache"); response.setDateHeader("Expires", 0);
Upvotes: 1