Codeigniter - get all users session data

Sabri Aziri picture Sabri Aziri · Mar 3, 2014 · Viewed 71k times · Source

I need to get all sessions data and take some actions upon them, is there any possible way to get them, I found how to solve it in php but codeigniter use's it own custom sessions library.

Native php

$_SESSION

How can I do it in codeigniter

Answer

Mohan picture Mohan · Mar 4, 2014

To get all session data you can use $this->session->all_userdata();

To print all your session variable use this line anywhere in your code :

echo '<pre>'; print_r($this->session->all_userdata());exit;