Search code examples
phpcodeignitercsrf

CSRF token Codeigniter


I am developing a website with CI and i have enabled CSRF for my forms which i am using with my website. The problem is that i want a form not to use the CSRF token. The reason is that the user is going to watch a video and the video is a little bit longer then the expiration and due to security reasons i cannot increase the expiry of the token. Moreover the form does not need to be secure as i making other hard coded filtering and sanitizing of the data and it doesn't make sense for the user to copy the form link and use it from another place.

Is it possible for this form to bypass the CSRF token?

Regards


Solution

  • I have found the solution. For those who are wondering about regarding the same problem here is the answer:

    in the config.php file where you enable csrf token there is an array element $config['csrf_exclude_uris'] which accepts uri to whitelist for the csrf mechanism to ignore.