Unlikenesses A Backend Developer

Tank Auth in CodeIgniter 3

22 October 2015

Porting a project built on CodeIgniter 2 to CodeIgniter 3, with a fairly heavily modified Tank Auth built in to it, I couldn't find any resources on how to get Tank Auth working in CI3. So here's a brief post to tell you what I did; hopefully it'll be useful for anyone else in the same situation.

In config.php, remove the options which are no longer in the new default config.php, and add the ones specified in the upgrade guide.

Set sess_driver to files.

In the Auth controller, remove $this->load->library('security'); this is because the security library is loaded automatically.

In the same controller, add $this->load->helper('security'); -- this allows the XSS clean method which is used in Tank Auth's default controller. You might as well also remove xss_clean from the validation rules in the Auth controller - these are now obsolete. See this this Stack Overflow question.

All this is of course assuming that the rest of the instructions in the upgrade guide have been followed.