Some forms in ThinkPHP will add a hidden hash value. Read the manual to prevent repeated submission of forms and other security protection measures. What is the security protection here? Some forms in ThinkPHP will add a hidden hash value. Read the manual to prevent repeated submission of forms and other security protection measures. What is the security protection here?
Reply content:
Some forms in ThinkPHP will add a hidden hash value. Read the manual to prevent repeated submission of forms and other security protection measures. What is the security protection here?
This is to prevent repeated submissions, because sometimes we can only allow users to submit
The principle is as follows: first, the hash value is generated by the server and then saved to the session. When the user submits the hash value, the user first checks whether the session exists, if the hash value exists, it is cleared. The next time the hash value is submitted, the submission will fail because it is invalid.
Security Protection should refer to CSRF Cross-Site Request Forgery