Page 1 of 1
Using browser back button
Posted: Fri Aug 23, 2002 3:32 am
by haagen
Often when I have written a page in php i can't use the back- and forward button in the browser. I think it have something to do with a http-header sent to the client. But I haven't figgured it out yet.
Someone care to explain how it works and how I can prevent this?
Posted: Fri Aug 23, 2002 5:34 am
by 9902468
when you push the back button what does it say?
warning! page is expired perhaps
or does the page just stop functioning correctly (Something is lost)
or or or
more details please
-9902468
Posted: Fri Aug 23, 2002 12:18 pm
by haagen
Right. The message is that the page has expired.
Posted: Fri Aug 23, 2002 2:18 pm
by 9902468
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
Then, you must send one of these headers?
either you get rid of those, (not recommended) or you accept that user can sometimes get that message. I really haven't educated myself enough that I could tell what you must do, but dynamic webpages are not supposed to be cached, as they might have changed. (But user can't see changes because page is loaded from old cache...)
hope that helped
-9902468
Posted: Fri Aug 23, 2002 2:24 pm
by hob_goblin
some of these things might also be held in <meta> tags
Posted: Fri Aug 23, 2002 2:32 pm
by haagen
Thanks. Now I have something more to go on.

Posted: Fri Aug 23, 2002 2:54 pm
by Takuma
It can happen when you using session I think.. but it might not.