Closed
Bug 269211
Opened 20 years ago
Closed 19 years ago
refresh after redirect tries to submit form from previous page
Categories
(Firefox :: Address Bar, defect)
Tracking
()
RESOLVED
EXPIRED
People
(Reporter: matt, Assigned: bugs)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
When creating forms that post I often redirect to another page after the POST
has been processed to avoid the "Your page contains postdata..." dialog when
people refresh or go back.
Now, after a person has been redirect if they press the refresh button it
re-submits the form. Here is a case where this is undesirable:
Someone enters data into a form on a message board and presses submit.
The form handler script processes their message and then redirects them to the
page where they can see the threaded messages.
They want to refresh the page periodically to see if anyone replies to their
message, but instead, it submits the form again.
Reproducible: Always
Steps to Reproduce:
1. Create a PHP that has two sections:
if(!$_POST){
// show a form
}else{
// handle the form
header("Location: Some.other.page.php");
exit;
}
2. Fill out the form and submit it
3. After being sent to the "some.other.page.php" press the refresh button.
Actual Results:
Form is submitted on each refresh.
Expected Results:
Mozilla, IE and previous versions of Firefox simply refresh the page (using the
GET URI specified in the location bar).| Reporter | ||
Comment 1•20 years ago
|
||
Hmm... I'm trying to create a test case for you to see it and it does not seem to happen on my test case, meaning this is an isolated problem. I will see if I can put together a reproducable testcase in a publically accessible area for you to see.
Comment 2•19 years ago
|
||
This is an automated message, with ID "auto-resolve01". This bug has had no comments for a long time. Statistically, we have found that bug reports that have not been confirmed by a second user after three months are highly unlikely to be the source of a fix to the code. While your input is very important to us, our resources are limited and so we are asking for your help in focussing our efforts. If you can still reproduce this problem in the latest version of the product (see below for how to obtain a copy) or, for feature requests, if it's not present in the latest version and you still believe we should implement it, please visit the URL of this bug (given at the top of this mail) and add a comment to that effect, giving more reproduction information if you have it. If it is not a problem any longer, you need take no action. If this bug is not changed in any way in the next two weeks, it will be automatically resolved. Thank you for your help in this matter. The latest beta releases can be obtained from: Firefox: http://www.mozilla.org/projects/firefox/ Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html Seamonkey: http://www.mozilla.org/projects/seamonkey/
Comment 3•19 years ago
|
||
This bug has been automatically resolved after a period of inactivity (see above comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → EXPIRED
I have the same bug, but without even having to post any data, so I don't think the bug is related to POST. I have a project that uses the URL rewrite module from apache (mod_rewrite).
When I refresh the page after being redirected by header('Location: http://website.com/page'), it refreshes the page I was on BEFORE the redirect, instead of the page I am currently on (The one displayed in the address bar), and so no mater how many times I redirect the user.
ex: I start at http://website.com/page1 and redirect to http://website.com/page2. http://website.com/page2 then redirects to itself in a loop (10 times or more). I refresh the page, and Firefox sends me on http://website.com/page1.
Other browsers do not display this behavior. The source of the bug seems to be Firefox's inability to recognize it is on a new page, probably due to the use of mod_rewrite.
I coded a workaround using $_SESSION variables, but it is slow and unpleasant.
I'll try to test if the same thing happens doing this test:
Start at http://website.com/page1 and redirect incrementally up to http://website.com/page9. Refresh the page, see where Firefox sends me.According to these comments (https://bugzilla.mozilla.org/show_bug.cgi?id=296147), http://website.com/page1 should not even be stored in the session history (it redirects instantly), but http://website.com/page2 should. However, it seems to be the other way around...?
Okay, I did the test I just told you about at the end of Comment 4.... It sent me back to http://website.com/page1!!! What I did: I started at http://website.com/page1, which redirects me (with header, not meta) to http://website.com/page2, and so on until http://website.com/page9. On http://website.com/page9, I hit refresh, Firefox refreshed http://website.com/page1!!!! I was on page9, Firefox should have refreshed page9! At least, that's what all the other browsers do (IE7/8, Opera, Chrome). My version is: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)
You need to log in
before you can comment on or make changes to this bug.
Description
•