How To Use csrf_exclude_uris in CodeIgniter 3+

For excluding the method one by one, you need to list it on the array,

[
    'controller/method_a'
    'controller/method_b'
    'controller/method_c'
];

There is a wild card for exclude 1 controller. For example you have log controller, and want to exclude all controllers not using CSRF token.

$config['csrf_exclude_uris'] = ["log.*+"];

.*+ is the wild card for the /method

Exit mobile version