Click to See Complete Forum and Search --> : PHP Page has expired
tripwater
05-01-2003, 04:52 PM
Hello I have a support section of my site for admin and there is a login with a user name and password. once logged in I have sess vars storing the user's info.
The problem I am having is in IE if the Admin is logged in and on a page and hits back to make a change he/she is greeted by a page that says Warning: Page has expired . Can someone tell me how to remedy this?
Thank you for any help in this matter.
PeOfEo
05-01-2003, 09:09 PM
well tha tis because that was a temporary page or something maybe using visible and invisible objects and a variable no longer exists so data has to be resent. I have no idea how to fix it with php. I don't have this problem on many of my asp.net pages but I did have it on a forum that used visible and invisible objects and I just avoid those and use a query string and it all works great so maybe if you did that.
tripwater
05-02-2003, 07:50 AM
Unfortunately I am not using invisible objects. I am using session_start() at the top of my pages...Is this maybe the issue?
I think that this is a problem with the browser caching the file. You could try setting some catch-control headers in you PHP page, like this (needs to be added to your page before anything is sent back to the browser):
<?PHP
header("Expires: ".gmdate("D, d M Y H:i:s")." GMT"); // Always expired
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");// always modified
header("Cache-Control: no-cache, must-revalidate");// HTTP/1.1
header("Pragma: nocache");// HTTP/1.0
?>
I belive another option is to use the GET method with you form, but, since you are using it for a login, that may be a bad idea...
hkloo
04-07-2008, 01:43 PM
This entry might be a bit late, since the last post on this topic is 2003. I came across this topic from google search when I was facing the same problem. So, I figure posting the solution here will be helpful for others.
Check out this link at http://shiflett.org/articles/how-to-avoid-page-has-expired-warnings
The problem is caused by session_start().
I did this and it goes away.
ini_set('session.cache_limiter', 'private');
session_start();