“Warning: page has expired” error in IE when hitti

2019-06-25 12:50发布

I have a classifieds website, and when posting a new classified users fill out a form offcourse. Then they hit the submit button, and a "verify" page appears which displays what they have filled out, and if it looks good, the users hit the "ok" button and the classified is posted.

Here is a short example:

  <form action="verify.php" name="main_form" etc

Then from verify.php if the classified looks good, they hit OK, and it is posted. However, here they have the option of clicking "back" to change something, which is where my problem comes in.

Now, at the bottom of the main_form, I have file-upload tool, which refreshes the page for each upload. This is what is causing the problem. However, it is too late for me to change it to a non-refreshing file-upload now (ajax for instance).

Anyways, the problem is that IF the user have uploaded a file and submits the page, the verify page opens. So from here the back button only displays a "Warning: page has expired" instead of showing the form with the images uploaded.

However, users are able to press F5 (refresh) to refresh the browser and the form will appear once again as it was, but this is no good solution.

How can I fix this?

And how come other browsers don't have this problem, they actually go back and display the full form with the images?

Also, offcourse, if no images are uploaded, the back button works fine in IE.

If you need more input let me know...

BTW; NOT TESTED IN IE8 YET.

2条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-06-25 13:13

see: Chris Shiflett: How to Avoid "Page Has Expired" Warnings:

Recap

To avoid "Page Has Expired" warnings, set session.cache_limiter to private, and make sure that any form using the POST method submits to an intermediate processing page that redirects the user to a different URL.

查看更多
在下西门庆
3楼-- · 2019-06-25 13:21

Just do not use verify.php, but make it all on the same page.
http://en.wikipedia.org/wiki/Post/Redirect/Get

查看更多
登录 后发表回答