CodeIgniter Forums
Problem with Sessions - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem with Sessions (/showthread.php?tid=22214)



Problem with Sessions - El Forum - 09-01-2009

[eluser]kbkb[/eluser]
Hi!

Try to using sessions. But it dont work.


$autoload['libraries'] = array("database", "session");


write it with
$this->session->userdata('capt', $captcha);


but if i want to read it on the next page load, there is nothing. I read it with:
echo $this->session->userdata('capt')

just empty. No Warning or Notice.. Sad


Problem with Sessions - El Forum - 09-01-2009

[eluser]bretticus[/eluser]
[quote author="kbkb" date="1251850412"]Hi!

Try to using sessions. But it dont work.


Code:
$autoload['libraries'] = array("database", "session");


write it with
Code:
$this->session->userdata('capt', $captcha);


but if i want to read it on the next page load, there is nothing. I read it with:
Code:
echo $this->session->userdata('capt')


just empty. No Warning or Notice.. Sad[/quote]

If you look at the manual more carefully, you'll notice that you have to write to the session using:

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



Problem with Sessions - El Forum - 09-01-2009

[eluser]kbkb[/eluser]
ahh shit. its very late. thank you very much!