Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 2.0 csrf switch
#1

[eluser]edhrx[/eluser]
I have a form thats in modal window that submits the post via ajax.

when $config['csrf_protection'] = FALSE; everything is ok
when $config['csrf_protection'] = TRUE; nothing is submitted.

Has a token been set which I need to validate ?. I'm not sure how to proceed
#2

[eluser]danmontgomery[/eluser]
The CSRF input is generated with form_open(), if you aren't using that you need to generate it yourself.

The fieldname and value are stored in the security library:

Code:
// Field needs to be named:
$this->security->csrf_token_name

// Value needs to be:
$this->security->csrf_hash




Theme © iAndrew 2016 - Forum software by © MyBB