4 ms·
Stupid question - couldn't (shouldn't) form submission be sort of idempotent? That is, if the same thing gets submitted again, drop it on the server side, rathe
by FabHK 3y ago
Stupid question - couldn't (shouldn't) form submission be sort of idempotent? That is, if the same thing gets submitted again, drop it on the server side, rather than doing all sorts of fancy stuff on the client?
- Toutouxc 3y agoShould I not be able to send money to the same person twice in a row? Unless you add a single-use token to the form, your server doesn't know whether it was a misclick or a legitimate action. The client more or less knows.
- omoikane 3y agoThe form should indeed include single-use tokens to allow server-side filtering of duplicates. Related: https://en.wikipedia.org/wiki/Replay_attack https://en.wikipedia.org/wiki/Replay_attack
- Waterluvian 3y agoYes it should be. But belt and suspenders. It’s crummy UX for it to happen in the first place. And an easy way to accidentally spam calls if someone’s cat sits on the enter key.
- SoftTalker 3y agoThank you, I was scanning the replies looking for this. If preventing duplicate submissions is a concern, you must prevent it on the server side. You should also try to prevent it on the client for a better UX.
- recursive 3y agoOnly sometimes. Whether it is in your case depends on the business rules of your application.