CodeIgniter CSRF + Ajax

Just discovered an issue while trying to post data to a controller in CodeIgniter with ajax. If you have CSRF protection enabled in your config.php, the Security class will check for the CSRF token to verify credentials. A quick and easy solution is to turn off CSRF protection in…