CodeIgniter Forums

Full Version: Multiple Session Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
Hi Everyone,

Is there any way to create multiple sessions at the same time in codeigniter ? I need to create multiple sessions ( Administrator and User) at the same time. Thanks in advance.

El Forum

[eluser]Dam1an[/eluser]
Why would you need that as 2 seperate sessions, instead of a single, combined session?

El Forum

[eluser]Colin Williams[/eluser]
I think you are confusing the role of sessions. More specifically, what are you wanting to do?

El Forum

[eluser]jayrulez[/eluser]
i think the person wants a result like

Code:
$_SESSION['user'] = 100;//user id
$_SESSION['admin'] = 'yes';

El Forum

[eluser]Colin Williams[/eluser]
Then

Code:
$session = array(
  'user' => 100,
  'admin' => 'yes',
);
$this->session->set_userdata($session);

How one could not glean that from the User Guide is beyond me. Maybe it is a different issue...