I recently started using CI and with it CI sessions, but I noticed that one thing in particular is much more time consuming for CI sessions than for basic PHP sessions: arrays.
I have an array of data that is saved regardless of logging in / out of the system called $_SESSION['stats'] , then I save the data in this array in the form:
$_SESSION['stats']['last_page'] = $_SERVER['REQUEST_URI']; .
And when the user logs out, he saves the statistics array in a variable, clears the session and then loads it back into the new session.
The problem is that to edit the key last_page instead of one line above I have to use this code:
$stats = $this->CI->session->userdata('stats'); $stats['last_page'] = $_SERVER["REQUEST_URI"]; $this->CI->session->set_userdata('stats', $stats);
This is one of the many troubles that I find in CI sessions that make me feel unsatisfied with it as a session handler. So my question is: which session system should I use with CodeIgniter? ... is there any reason to use CI sessions? Is there a CI library you would suggest? Why not just use PHP sessions?
Thanks,
Lemiant
source share