CodeIgniter Forums
Non-expiring session - 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: Non-expiring session (/showthread.php?tid=14217)



Non-expiring session - El Forum - 12-23-2008

[eluser]m_i_n[/eluser]
I think this i very stupid move to use 0 as non-expiring session in this part of code:

Code:
// Set the session length. If the session expiration is
// set to zero we'll set the expiration two years from now.
if ($this->sess_expiration == 0)
{
    $this->sess_expiration = (60*60*24*365*2);
}

because the 0 in set_cookies is usefull value to (from php.net):

Quote:If set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes).

In this situation i cant create session in CI whitch expire when the client close browser :\

-1 will be better value for non-expiring session.

Ok, i know, i can delete this part of code but i dont want to do that on every new version of CI.

Sorry for my english.