Say I'm on / page? id = 1
Then I go to / page? id = 2
And am I making changes on this page that implements the message and then redirects back to / page? id = 2
In Firefox, can I click the "once" button once and return to / page? id = 1, but in Chrome and Safari on the iPhone I need to press the back button twice because / page? id = 2 is in the browser history twice. (And if I made several messages with id = 2, I would have to click the "Back" button to repeatedly return to id = 1.)
In a sense, this is similar to the normal behavior of the browser, as each GET is simply inserted into the history, but since the URL is identical to the previous record, this leads to a bad user experience, which is usually avoided by other web applications ... and, of course, you can Avoid in Firefox. Is this an unavoidable error in Webkit browsers, or can I implement PRG differently to avoid this?
btw- the behavior is similar to the same redirect from 302 or 303.
UPDATE: I was mocking some sample code ... I don't know if there is a platform like jsfiddle where I can download this for you to see in action:
form.php:
id=<?=$_REQUEST['id']?> <form action="submit.php" method="post"> <input type="hidden" name="id" value="<?=$_REQUEST['id']?>"> <input type="submit" value="submit"> </form>
submit.php:
<?php header("Location: form.php?id=" . $_REQUEST['id']); die($_REQUEST['id']); ?>
Should I start with form.php? id = 4 (just to put it in your browser history) and then go to form.php? id = 5, and then click submit (as if to make a database change), in Firefox I get one history entry for each; in Chrome, I get one entry for id = 4, and then two entries for id = 5. Why is there a difference in behavior? I think Firefox's behavior is better, as striking twice back to get away from id = 5 is intuitive for the user.
html google-chrome post-redirect-get mobile-safari webkit
dlo
source share