CodeIgniter Forums
Session data handling - 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: Session data handling (/showthread.php?tid=21812)



Session data handling - El Forum - 08-21-2009

[eluser]medvind[/eluser]
Hello!
I'm trying to understand the session class.

I have multiple controllers that will write to and read from the session cookie. Let's say we've got Controller A and Controller B.

Now, when Controller A does this:
Code:
$userdata['test'] = "hello";
$this->session->set_userdata($userdata);

And Controller B does this:
Code:
echo $this->session->userdata('test');

I expect to get a "hello". Instead there is nothing. The user data is gone. I must have misunderstood something here, but what?


Session data handling - El Forum - 08-21-2009

[eluser]medvind[/eluser]
Never mind this. It was all because of my customized routing. I thought I was looking at Controller B when it was another one altogether...