2 ms·
HTML Forms: How (and Why) to Prevent Double Form Submissions
- enz 6y agoClient side is handled well, but I think backend still needs to enforce the "only one submission". For that, I use an idempotency key. You generate a random key (UUID4 is fine) which is passed alongside your form. If (for a reason or another) the same form is sent (with the same key), the backend will ignore it because it has already seen that key before. It allows to implement an idempotent behaviour.