I would like the page to expire when the back button is pressed so the message "Warning: Page has Expired etc" appears. I have found some suggestions in this forum and applied them, their not working for me, so I must be doing something wrong. I have tried the following response header combinations"
I would like the page to expire when the back button is pressed
Controlling browser back button from server code is not possible. You got to use sessions(after proper authentication)along with response header to prevent restricted resources from being accessed by un-authenticated users.
[ December 09, 2005: Message edited by: Vishnu Prakash ] [ December 09, 2005: Message edited by: Vishnu Prakash ]
You can use those response header in order to tell the browser that please dont cache the page. But it might not work with all browsers. I guess it doesn't work with IE.
Otherwise, if back button just work like a new request, then you can do as Vishnu already said that you need to use session for this. After a successful login you can put the user bean into session and then check for that in session if found then OK otherwise redirect to login page.
posted 14 years ago
Thanks for replying. I understand that I can create a session object to track the users activity and can redirect them when they reach a stale page. However I would like to pursue the Page expired message when the user moves back to a stale page. Is there some other technology involved beyond setting response headers in a JSP or Servlet that cause this to occur? I am running IE 6.0, I see the "page expired" message frequently on my machine. I am doing this for a school project.