Welcome Guest, Not a member yet? Register   Sign In
Storing Array Data in CI Session
#1

[eluser]Kyle Johnson[/eluser]
Good Morning,

I am hoping someone can help me with this small question.

I use the database version of the CI Sessions to store permissions. It is stored as an array.

Code:
$this->session->set_userdata('permissions', $permissions);

Is there a way to get specific array data from within the session?
Code:
$permissions = $this->session->userdata('permissions["shp"]'); // Example, this does not actually work!!

Currently I have to do the following:
Code:
$permissions = $this->session->userdata('permissions');
echo $permissions['shp']['add'];

This isn't a huge deal, but I would prefer not to have to load the entire permissions dataset into each page that needs permissions.

Any thoughts?


Messages In This Thread
Storing Array Data in CI Session - by El Forum - 04-24-2009, 10:30 AM
Storing Array Data in CI Session - by El Forum - 04-24-2009, 10:53 AM
Storing Array Data in CI Session - by El Forum - 04-24-2009, 11:16 AM
Storing Array Data in CI Session - by El Forum - 04-24-2009, 05:01 PM
Storing Array Data in CI Session - by El Forum - 04-25-2009, 12:34 AM
Storing Array Data in CI Session - by El Forum - 04-25-2009, 12:40 AM
Storing Array Data in CI Session - by El Forum - 04-25-2009, 04:10 AM
Storing Array Data in CI Session - by El Forum - 04-25-2009, 07:23 PM
Storing Array Data in CI Session - by El Forum - 04-26-2009, 11:29 PM
Storing Array Data in CI Session - by El Forum - 04-27-2009, 11:00 AM
Storing Array Data in CI Session - by El Forum - 02-26-2010, 08:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB