For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > December 2004 > How to avoid accidental re-sending of POST data









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to avoid accidental re-sending of POST data
Ingo Weiss

2004-12-02, 8:55 am

Hi,

this must be a common problem and I was wondering what commonly used
strategies to solve it are:

How can I avoid that a user re-sends a POST form when hitting the reload
button on a result page?

The browser typically warns you when you want to do that but I was
wondering whether there is an easy way to make it impossible.


Thanks for any hint!
Ingo Weiss








Bob Showalter

2004-12-02, 3:55 pm

Ingo Weiss wrote:
> Hi,
>
> this must be a common problem and I was wondering what commonly used
> strategies to solve it are:
>
> How can I avoid that a user re-sends a POST form when hitting the
> reload button on a result page?


You can't. If the transaction is not repeatable, you need to have some way
on the server side to detect that the transaction has been previously
submitted and reject it on subsequent submissions.

Assigning a unique transaction ID number to each transaction is one way of
doing it.

>
> The browser typically warns you when you want to do that but I was
> wondering whether there is an easy way to make it impossible.


Nope. You have to deal with it on the server side.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com