CSRF Protection in CodeIgniter — a practical guide to CodeIgniter CSRF with clear examples you can reuse in real projects.
CodeIgniter Tutorial Series (56/74). Prefer one article? Read the complete CodeIgniter tutorial.
Short description
CI can auto-check CSRF tokens on POST/PUT/DELETE. Include the token in forms and AJAX headers.
CSRF field in form
<?= csrf_field() ?>
<!-- or -->
<input type="hidden" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>" />