Quentinv
Quentinv

Reputation: 33

Cakephp : Security Component and double click

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.

Upvotes: 1

Views: 366

Answers (1)

ADmad
ADmad

Reputation: 8100

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.

Upvotes: 2

Related Questions