Cakephp : Security Component and double click

372 Views Asked by At

I am using cakephp and security component for form and it is working well.

But I have a question, every time someone double click on the send button (for example when someone use a form that send data in my database) they are blackholed. Probably because cakephp think they are sending the data from the form 2 times in the database...

Someone knows how to fix this ? Maybe it is possible to disable this option.

1

There are 1 best solutions below

0
On

Probably because cakephp think they are sending the data from the form 2 times in the database...

Well if they click on send button twice they are submitting the form twice, it really isn't Cake's fault.

You can use javascript to disable button after click. That will prevent double submission. You can also set SecurityComponent::$csrfUseOnce to false to allow CSRF token reuse until it expires.