wood burning stoves 2.0*
The moose likes Servlets and the fly likes Warning: Page has Expired Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Warning: Page has Expired" Watch "Warning: Page has Expired" New topic
Author

Warning: Page has Expired

Beksy Kurian
Ranch Hand

Joined: Jul 11, 2001
Posts: 254
If a user uses the back button to browse the previous pages(only the page which comes after a POST operation), he gets a message in IE...
"Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.
To resubmit your information and view this Web page, click the Refresh button."
I am setting the header to no-cache. Thinking that this is the problem, I changed the code like this
if (request.getMethod()=="GET")
{ response.setIntHeader("max-age", 0);
response.setHeader("Cache-Control","no-cache");
response.setIntHeader ("Expires", -1);
response.setHeader("Pragma","no-cache");
}
It doesn't help. I even tried to change the browser cache properties so that it will cache always(which I don't like to do).any ideas on how to fix the problem?
Beksy Kurian
Ranch Hand

Joined: Jul 11, 2001
Posts: 254
I have gotten the following document from microsoft page http://support.microsoft.com/support/kb/articles/Q183/7/63.ASP
I had already disabled 'do not save encrypted pages to disk". still it doesn't work. and I am using IE 5.0. Even netscape has the same problem. a slight change in the error message though. Has anybody done any work around for this problem?
Beksy
Beksy Kurian
Ranch Hand

Joined: Jul 11, 2001
Posts: 254
I am adding a message which I got from PHP forum. I would like to know whether we can do something like this if we are using servlets(Jrun-servlet engine and apache server).
"Author: Anthony Boyd (209.78.54.19)
Date: 2001-04-12 18:10:52
I am adding this comment months after the original message just in case someone is doing a search for this very problem. Because there is a perfect solution that is not mentioned here.
When you use PHP's sessions, you get "page expired" errors when using the back button because PHP's session management sends out a "nocache" header. You can change that header to instead send "private" or "public" and suddenly your back button will again. However, your pages will be outdated -- never grabbing fresh data, always showing the same listing. To solve this, you want to completely BLANK OUT the header. How do you do this? In php.ini, make the session.cache_limiter look like this:
session.cache_limiter = ;
That's right, no value. You do this, and viola, the cache control returns to "at the browser's discretion" -- which means, you always get fresh data, and you never see a "page expired" warning. Yay."
appreciate a reply
Beksy
 
wood burning stoves
 
subject: Warning: Page has Expired