Re:Idempotence: What is it and why should I care?
by chaboud on Tuesday August 21, 2018 @06:43AM
(#17808494)
You can do a mix of the two to reduce server traffic (especially for abandoned sessions) and user latency.
Give the client a client ID that you generate that should be properly random... Have them submit that ID along with their self-generated ID.
Why not generate the UUID on the server and send it to the client along with the page request (if using SSR)? I.e. the server generates the UUID, sticks it in a database field, then sends it to the client. When the client responds with the UUID, you can check that against the database to make sure its valid.