I am busy with a site which has only one page, accessible only after logging in: home.jsp
. Once user is logged in with a valid session, if he presses the back button on the browser then he should be redirected to login.jsp
and again if he presses the browser's forward button. He should not be able to get to home.jsp
without logging in. So after doing some searches, I've implemented:
<%
response.setHeader ( "Cache-Control","no-cache,no-store,must-revalidate");
response.setHeader("Pragma","no-cache");
response.setDateHeader ( "Expires", 0)
%>
On the home.jsp
page and upon pressing the forward button, it's saying web page has expired, but what I'm looking for is my cutom page, something like sessionExpired.jsp
saying log in again...
Please help me out with how to fix this.