Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Back Button Error

52 views
Skip to first unread message

theou...@gmail.com

unread,
Mar 21, 2005, 9:48:46 AM3/21/05
to
After submitting a form from a PHP script and using the back button I
get a page cannot be displayed error. Everything works find except when
the back button is used. Using IE with SP2 on Windows XP Pro any ideas?

R. Rajesh Jeba Anbiah

unread,
Mar 21, 2005, 12:27:09 PM3/21/05
to
Q: Why am I getting "Warning: Page has Expired" error when hitting back
button after form submit?
Q: How do I preserve form data after submitting but returning using
back button?

A: When the browser looks the page in the cache and if the page is not
available there, you may be getting "Warning: Page has Expired" error.
This usually happens when the page uses session as PHP's default
session.cache_limiter setting is "nocache"--which will send nocache
HTTP header to the browser.
So, the workaround is to forcibly send the HTTP headers so as to force
the browser to cache the page.
If using session, add session_cache_limiter('private,
must-revalidate');
Otherwise, add header('private, must-revalidate');
This may solve the issue.

Refer:
http://www.php.net/sesssion_cache_limiter
http://www.php.net/header

paristhedog

unread,
Mar 21, 2005, 12:56:21 PM3/21/05
to
Thanks but that didn't seem to help. I am still getting the following
using the back button (other pages from other sites work fine):

The page cannot be displayed
The page you are looking for is currently unavailable. The Web site
might be experiencing technical difficulties, or you may need to adjust
your browser settings.

R. Rajesh Jeba Anbiah

unread,
Mar 21, 2005, 1:05:50 PM3/21/05
to

Sniff the header and post here. Just curious to look at the header.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jørn Dahl-Stamnes

unread,
Mar 29, 2005, 3:02:42 AM3/29/05
to

I have only had experience of this as a user on a web-site. IE 6.0 gave me
this "error messages" all the time. After I changed my browser to FireFox, the
"error" was gone.

--
Jørn Dahl-Stamnes
Homepage: http://www.dahl-stamnes.net/dahls/

John Dunlop

unread,
Mar 29, 2005, 2:00:14 PM3/29/05
to
Jørn Dahl-Stamnes wrote:

[about IE's 'Warning: Page has Expired' nonsense]

> I have only had experience of this as a user on a web-site.

For no fault of the Web site author, let it be said.

> IE 6.0 gave me this "error messages" all the time. After I changed
> my browser to FireFox, the "error" was gone.

Because the warning is a bug, which real browsers, like your
Firefox, are free of.

You bring up a good point, one worth noting in the FAQ, I
daresay. That is, as far as I know, the workaround exists
solely to counter IE's misbehaviour. I'd be saddened to learn
of other browsers with this bug.

The workaround affects everyone though. Before, the provider
asked for the page not to be cached, but now, just because of
IE, he's asking for it to be cached. That's wrong.

--
Jock

R. Rajesh Jeba Anbiah

unread,
Apr 2, 2005, 2:58:09 PM4/2/05
to
Q: Why am I getting "Warning: Page has Expired" error when hitting back
button after form submit?
A: This is IE only error. When IE looks the page in the cache and if

the page is not available there, you may be getting "Warning: Page has
Expired" error. This usually happens when the page uses session as
PHP's default session.cache_limiter setting is "nocache"--which will
send nocache HTTP header to the browser.
So, the workaround is to forcibly send the HTTP headers so as to force
IE to cache the page.

If using session, add session_cache_limiter('private,
must-revalidate');
Otherwise, add header('private, must-revalidate');
This may solve the issue.

Q: How do I preserve form data after submitting but returning using
back button?
A: You can instruct the browser to cache the page by sending proper
HTTP headers. But, note that the browser setting will take priority in
determining whether to follow the HTTP headers or not.


If using session, add session_cache_limiter('private,
must-revalidate');
Otherwise, add header('private, must-revalidate');

Refer:
http://www.mnot.net/cache_docs/

+++++
@revision 2 See comments. The bug is IE only

0 new messages