Preventing double HTTP POST

前端 未结 11 846
死守一世寂寞
死守一世寂寞 2020-12-29 05:23

I have made a little app for signing up for an event. User input their data and click \"sign me in\".

Now sometimes people are double in the database, the exact sam

11条回答
  •  灰色年华
    2020-12-29 06:02

    A client-only solution won't be enough, as stated in many of the answers here. You need to go with a server-side fail-safe.

    An often overlooked reason that disabling the submit button doesn't work is, the user can simply refresh the submit target (and click OK on the "are you sure you want to resubmit the POST data?" dialog). Or even, some browsers may implicitly reload the submitted page when you try to save the page to disk (for example, you're trying to save a hard-copy of an order confirmation).

提交回复
热议问题