EllisLab/CodeIgniter — Issue #744: CI's session handling not working in WebKit browsers and IE
Author: jgdev
Created: 2011-12-07 03:10:33+00:00
State: open

Data stored using CodeIgniter's session library is not persisted between requests in browsers other than Firefox.

To recreate this problem install a fresh copy of CI 2.1.0, add an encryption key to application/config/config.php, then add the following three lines to the constructor of application/controllers/welcome.php:

$this->load->library('session');
$session_id = $this->session->userdata('session_id');
echo "My Session ID is $session_id";

Viewing this page in a browser should display the current session id and this id should remain the same if the page is reloaded. However, in Safari, Chrome, and IE reloading the page causes the session id to change. Something in the way CodeIgniter stores session data is triggering the session id to change which means any data stored in the session cannot be persisted from one request to the next.