Home > PHP Framework > ThinkPHP > Why does the TP form hide the hash value?

Why does the TP form hide the hash value?

藏色散人
Release: 2021-12-06 15:47:02
forward
1821 people have browsed it

The following thinkphp framework tutorial column will introduce to you why the TP form hides the hash value. I hope it will be helpful to friends in need!

Why does the TP form hide the hash value?

Some forms in ThinkPHP will add a hidden hash value. According to the manual, it is to prevent repeated submission of the form and other security protections. What is the security protection here? ?

What is the reason why ThinkPHP forms hide hash values?

Then read the answer~

This is to prevent repeated submissions, because sometimes, we can only allow users to submit once

The specific principle is as follows:

First of all, this hash value is generated by the server, and then saved in the session. When the user submits, first determine whether it exists in the session. If it exists, clear the hash value. When submitting next time, because the hash value has been If it is invalid, the submission will fail.

Recommended: "The latest 10 thinkphp video tutorials"

The above is the detailed content of Why does the TP form hide the hash value?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template