Creating API for web app with CodeIgniter CSRF protection
check out implementation of CSRF in codeigniter from net.tutsplus.com.
I hope that will solve your problem.if you implemented correctly than write this inside you config.php
if (isset($_SERVER["REQUEST_URI"])) { if(stripos($_SERVER["REQUEST_URI"],'/mypage') === FALSE) { $config['csrf_protection'] = TRUE; } else { $config['csrf_protection'] = FALSE; } } else { $config['csrf_protection'] = TRUE;}