If you’ve used AJAX-heavy web apps built on a CI backend, you might have noticed premature session expiration, even if you’re expiration was set to never expire ($config[‘sess_expiration’] = 0; in application/config/config.php)

This was apparently due to AJAX requests not regenerating sessions, and apparent collisions. Long story short, there was a patch introduced without much fanfare, which seems to be working with codeigniter 2.1.3 .

Replace your system/libraries/Session.php file with the one found here (CI’s git):

https://raw.github.com/EllisLab/CodeIgniter/b211adee89f5fd2192051e9c0826146bd150f469/system/libraries/Session.php