After processing the POST request, I do a very standard redirect to the same page so that the user does not get the "Confirm form re-fill" dialog box (or equivalent) if they reload the page.
I am using response status code 303.
Here is the code:
header( "HTTP/1.1 303 See Other" ); header( "Location: " . $_SERVER['REQUEST_URI'] ); exit();
This works in both Safari and FF. Chrome opens the "Resubmit Form Confirmation" dialog box.
In Chrome, I can use the network inspector to make sure that the 303 redirect is indeed released, and there is a GET after my initial POST.
However, if I try to reload the page at this point, I get a "Re-form confirmation form".
If I change the URL by adding a fake request parameter, this will not happen. It...
header( "HTTP/1.1 303 See Other" ); header( "Location: " . $_SERVER['REQUEST_URI'] . '?foo' ); exit();
... works great.
Is Chrome too smart and momentary to reload the same page? Or is this a known issue? I spent some time looking around, but apart from a million times when people just needed to use the PRG template, nothing.
Greg
source share