CodeIgniter Forums
Multiple Session Problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Multiple Session Problem (/showthread.php?tid=19838)



Multiple Session Problem - El Forum - 06-20-2009

[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.


Multiple Session Problem - El Forum - 06-20-2009

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


Multiple Session Problem - El Forum - 06-20-2009

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


Multiple Session Problem - El Forum - 06-20-2009

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

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



Multiple Session Problem - El Forum - 06-22-2009

[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...