Welcome Guest, Not a member yet? Register   Sign In
Session not being destroyed upon the browser closure
#3

[eluser]WanWizard[/eluser]
The current CI session library doesn't support the option at the moment.

Normally you would use a session timeout value of zero, which on the session cookie means 'valid until the browser closes'.

However, the CI session library says:
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);
}

I solved this by adding this bit of code to my MY_Session library (create it if you don't have one):
Code:
// call the parent constructor
parent::CI_Session();

// reset the session expiration to zero here, to work around the CI
// assumption that a zero value means '2 years', instead of 'end of session'!
$this->sess_expiration = 0;


Messages In This Thread
Session not being destroyed upon the browser closure - by El Forum - 10-05-2009, 11:36 PM
Session not being destroyed upon the browser closure - by El Forum - 10-06-2009, 01:09 AM
Session not being destroyed upon the browser closure - by El Forum - 10-06-2009, 04:27 AM
Session not being destroyed upon the browser closure - by El Forum - 10-07-2009, 08:39 AM
Session not being destroyed upon the browser closure - by El Forum - 10-07-2009, 08:58 AM
Session not being destroyed upon the browser closure - by El Forum - 10-07-2009, 10:46 AM
Session not being destroyed upon the browser closure - by El Forum - 10-07-2009, 10:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB