Dear All
Commonly when I am POST-ing information from one page to another, when I press back I (seemingly randomly) get the typical 'Web Page Has Expired' message, and the request to refresh.
Is there any way I can get it to refresh automatically (on all platforms) without the need to hit the refresh button, and therefore get rid of these unprofessional-looking messages?
Many thanks
Mark
Can you resubmit automatically without need for refresh?
Moderator: General Moderators
No there isn't. This is built into the browser. The reason it says the page has expired is of course because the POST variables are part of the page, and after the form has been submitted, the page no longer exists (kind of). The only pseuod-way to get around this is to put a "back" link in your page somewhere.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
-
aleigh
- Forum Commoner
- Posts: 26
- Joined: Thu Mar 25, 2004 11:06 am
- Location: Midwestern United States
- Contact:
Re: Can you resubmit automatically without need for refresh?
The problem that you are describing is that the browser has returned to an URL that required POST data. Browsers handle this differently but basically the browser is giving you the dialog because it is concerned that by re-posting the form variables it will cause a side-effect operation like buying you an extra digital camera on amazon.mjseaden wrote:Dear All
Commonly when I am POST-ing information from one page to another, when I press back I (seemingly randomly) get the typical 'Web Page Has Expired' message, and the request to refresh.
Is there any way I can get it to refresh automatically (on all platforms) without the need to hit the refresh button, and therefore get rid of these unprofessional-looking messages?
Many thanks
Mark
I have not found any really swell answers to this problem, but I will share one idea; when you 302 the incident page that generated the 302 is stripped from the browsers page. For example
A -> B(302) -> C
When you hit back on C you will go to A, not B. Therefore if you store the result data in the session and 302 them once you receive the post data they will arrive at a page that they will GET rather than POST therefore avoiding the error should they hit back.
I almost feel embarassed suggesting this, so take that for whatever it might be worth.
I generally just live with the problem and try to provide them sufficient in-page navigation that they do not use the back button, but it's a hard habit to break for sure.