CodeIgniter Forums
csrf_exclude_uris not work - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: csrf_exclude_uris not work (/showthread.php?tid=73163)



csrf_exclude_uris not work - arxiba - 03-25-2019

$config['csrf_protection'] = true;
$config['csrf_token_name'] = 'csrf_token_test';
$config['csrf_cookie_name'] = 'csrf_cookie_test';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array('/assistant_dashboard/upload.html');
Confused
I upload file to '/assistant_dashboard/upload.html' but the 'csrf_exclude_uris' not work.
Please show me how to do?


RE: csrf_exclude_uris not work - dave friend - 03-28-2019

The URIs should follow the pattern of controller/method and should not begin with a slash. So assuming the controller is assistant_dashboard and the method is upload the setting should be

$config['csrf_exclude_uris'] = array('assistant_dashboard/upload');