Re: PRG pattern - how to implement a "load page using GET"
| From: | Jochem Maas | Date: | Mon, 17 Dec 2007 09:41:43 +0000 |
| Subject: | Re: PRG pattern - how to implement a "load page using GET" | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-265968@lists.php.net to get a copy of this message | ||
Per Jessen schreef:
> Robert Erbaron wrote:
>
>>> yes - abusing redirects as described is wasteful. and certainly it's
>>> the first time I've ever heard the statement 'Never show pages in
>>> response to POST' sounds like hubris too me.
>> I've seen the statement in a number of messages in the archives here
>> and in google searches.
>
> Personally, I try to avoid the situation where you might get a
> double-POST if the user decides to do a reload/refresh. Which means
> processing the POST-request, but finish it off with a 303 redirect.
>
this can still be 'broken' by using the back button ... I find a safer way
(if the application design allows it) is to include a one-time token with
each POST request - if a token has already been used (or is invalid) the POST
processing is not done.
>
> /Per Jessen, Zürich
>