Welcome Guest, Not a member yet? Register   Sign In
Prevent duplicate db's row
#11

CSRF is enabled through filters.
Reply
#12

Cookie based CSRF protection may not protect the serial submissions?

How about setting $csrfProtection = 'session' ?
https://codeigniter.com/user_guide/libra...on-methods
Reply
#13

Well, the easiest solution for frontend developers is to disable the button after you click it. It is easy.


You can either Google it or check one of the results : StackOverflow (Check also the jsfiddle).
Reply
#14

(02-23-2022, 03:50 AM)demyr Wrote: Well, the easiest solution for frontend developers is to disable the button after you click it. It is easy.


You can either Google it or check one of the results : StackOverflow (Check also the jsfiddle).

I have 21 button in this page ( every button create a row in a table, not the same table ) , i cannot disable all the button ....

this is my env :

app.CSRFProtection  = true
app.CSRFTokenName  = 'xxxxxxxxxxxxxxxxxx'
app.CSRFCookieName  = 'xxxxxxxxxxxxxxxxxxxxx'
app.CSRFExpire      = 7200
app.CSRFRegenerate  = true
Reply
#15

(02-23-2022, 05:13 AM)pippuccio76 Wrote: I have 21 button in this page ( every button create a row in a table, not the same table ) , i cannot disable all the button ....

this is my env :

app.CSRFProtection  = true
app.CSRFTokenName  = 'xxxxxxxxxxxxxxxxxx'
app.CSRFCookieName  = 'xxxxxxxxxxxxxxxxxxxxx'
app.CSRFExpire      = 7200
app.CSRFRegenerate  = true

I really wonder the design of the work, 21 buttons on a page? It means 21 forms also?

You don't need to disable all the buttons. They have a class and only the clicked one (this) will be affected like in the example I shared with you: jsfiddle
Reply
#16

(02-23-2022, 05:28 AM)demyr Wrote:
(02-23-2022, 05:13 AM)pippuccio76 Wrote: I have 21 button in this page ( every button create a row in a table, not the same table ) , i cannot disable all the button ....

this is my env :

app.CSRFProtection  = true
app.CSRFTokenName  = 'xxxxxxxxxxxxxxxxxx'
app.CSRFCookieName  = 'xxxxxxxxxxxxxxxxxxxxx'
app.CSRFExpire      = 7200
app.CSRFRegenerate  = true

I really wonder the design of the work, 21 buttons on a page? It means 21 forms also?

You don't need to disable all the buttons. They have a class and only the clicked one (this) will be affected like in the example I shared with you: jsfiddle

I dont tink this Is the correct way , a user must do wrong chois , disable all Button Is not good
Reply
#17

Disable the button.
Make an AJAX request.
Enable the button.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB