Welcome Guest, Not a member yet? Register   Sign In
Enabling CSRF to TRUE in CodeIgniter
#1

Just read that CodeIgniter 2.x has built-in CSRF protection. Now upon reading the documentation, I didn't found anything relating CSRF, just an option of setting it to TRUE in the config.php file then that's it. However, in my system I don't use this form_helper which automatically incorporates the CSRF protection of the CodeIgniter, instead I have the native <form> of HTML.

My concern is do I need to do anything to implement the CSRF of CodeIgniter, or just setting the option to TRUE is enough?
Reply
#2

(This post was last modified: 12-20-2022, 03:49 AM by captain-sensible.)

is this any help https://code.tutsplus.com/tutorials/prot...-net-19644

basically it shows how to check if token was produced. im using CI4 and i did wonder if a csrf token was being produced; i confirmed that in CI4 , in the controller that is sent data from form to process

Code:
$lucky= $this->request->getVar(csrf_token());
        //above i used to check there was a token which can be echoed out
CMS CI4     I use Arch Linux by the way 

Reply




Theme © iAndrew 2016 - Forum software by © MyBB