CodeIgniter Forums
Questions regarding CI_Session and session regeneration - 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: Questions regarding CI_Session and session regeneration (/showthread.php?tid=4314)



Questions regarding CI_Session and session regeneration - El Forum - 11-17-2007

[eluser]David Cassidy[/eluser]
I have a few questions regarding the way CI_Session (the default session library) handles regenerating sessions.

For simplicity, let's say that, sometime during the user's visit, some custom userdata is created for him/her using:
Code:
$this->session->set_userdata('item', 'value')

After a brief period of time the user closes his/her browser, only to return shortly afterwards.

My questions are as follows:

Assuming the session cookie HAS NOT expired, will a new session be generated? If so, will the custom userdata still be available for retrieval? And, if the session cookie HAS expired, the session will obviously need to be regenerated, but will the custom userdata be destroyed then?