Is there any built-in method in cakephp to prevent repeated form submission? how can this problem be solved?

Source: Internet
Author: User
Is there any built-in method in cakephp to prevent repeated form submission? for example, if I do a user registration function, click submit to the information confirmation page, click submit, and enter the database. (information validation is not performed when receiving the database, for example: check whether the user name already exists ). & Nbsp; after I enter the database, click the back button of the browser to return to the information confirmation page. at this time, I click Submit. because no verification is performed, the user's information will be rechecked into the database. & nbsp; I just want to see if there is any built-in method in cakephp to prevent repeated form submission.
For example, if I create a user registration function, click submit to the information confirmation page, click submit, and enter the database (information validation is not performed when the database is in place, for example, whether the user name already exists, check the information on the information confirmation page ).
After I enter the database, click the back button of the browser to return to the information confirmation page. at this time, I click Submit. because no verification is performed, the user's information will be rechecked.

I just want to ask cakephp built-in methods. I know about these methods like token verification.

It's not long before you get started with cake.

------ Solution --------------------
Look at http://www.ibm.com/developerworks/cn/opensource/os-php-cake3/
Here we are talking about
Introduction to cache
Although the use of requireAuth protection has obvious advantages, there are also some shortcomings to be overcome. Most of the disadvantages are Cache problems ".
Each time a form is evaluated by requireAuth, a verification key is generated. This means that if a user submits a form containing a used key, the form submission operation will be considered invalid. This problem may occur in several situations, including (but not limited to) using multiple browser windows, using the Back button to return to the previous page, browser cache, proxy server cache, and so on. You may think of these problems as user errors, so ignore them. you should resist the temptation and begin to process invalid form submissions.

If you use security, when submitting a form, cakephp will automatically verify the token and session in the form, you can unset the token value in the session after receiving the database. no matter how the user returns to the confirmation page, cakephp will check the submission and roll back if the check fails. you can write a rollback method by yourself to prompt.
If you understand the core code, you will understand this process.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.