I am trying to pass some data into my Controller, but I\'m getting a 500 error. After some research, I discovered that it\'s caused by the CSRF token not being sent.
CI stores csrf in cookie and you can fetch it from there:
var csrf = $.cookie('csrf_cookie_name');
The downside of this method is that jQuery doesn't natively provide cookie access. So you will need a jquery plugin.