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
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;
You can use db session. So data will be stored to the database. See Saving Session Data to a Database
If you have no database support just use cookie and get the data with
$username = 'John Doe';
$this->session->set_userdata('username',$username);
$var = $this->session->userdata;
echo $var['username'];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With