Exact Duplicate: How to handle multiple submissions server-side
The general task at hand: preventing a double form submission in a multi-user web based application. Think financial transactions.
I have two methods which can be used in tandem:
- JavaScript disabling of button
- Disadvantage: does not work if JavaScript is disabled
- Back-end verfication - see how long ago the last request of this type came from this user and issue error if not too long ago
- Disadvantage: If the two submissions are close enough together, each may not be able to be aware of the other
I am looking for subject matter experts to contribute their best practices as well as esoteric tricks. Can be any language and framework, but Django is of specific interest. A lot has been written on the web about the task at hand, but it would be nice to have the best practices shown here.