Tutorialsplane

Codeigniter print session data variable array


Codeigniter print session data variable array : Codeigniter Session class is used to deal with session. We can use $this->session->userdata to get all session data in codeigniter. Here in this tutorial, we are going to explain how you can get session data in codiegniter and print the array.

Example : Codeigniter print session data variable array

There are following ways to access the array data in codeigniter.

print_r($this->session->userdata);

Or

$sessionData = $this->session->all_userdata();
print_r($sessionData);

Both will return associative array of the session.