Token prevents forms from repeatedly submitting questions

says that the backend generates a token and puts it in session, and when submitting the form, it also takes a token, to compare it with the token in session.
how is the inconsistency between the token in session and the token in the form formed? Is the token submitted in the form taken from session?

Dec.13,2021

there is no inconsistency for the front end, so whether the data is duplicated or not is also controlled by the back end.

the user clicks at the speed of light twice. If the front end does not judge, the same data will be sent twice.

the backend performs the corresponding operation when the data is received for the first time, and a new token is generated and transmitted to the client.

at this time, the backend receives the second request from the second company of the speed of light, or the token, of the previous request has expired, and the second request is invalid.

Menu