Session expiration: does it get renewed on each request?

In my config/config.php I have this:

$config['sess_expiration']        = 7200;

So my session will expire after 2 hours.

Question: is that 2 hours after the session is created? Or 2 hours after last activity/request?

Reading through the session library (in system/libraries), this

// Is the session current?
if (($session['last_activity'] + $this->sess_expiration) < $this->now)
    return FALSE;

would suggest that the session expiry is the last activity + the session expiration time, so yes, 2 hours after the sessions last activity in your case.

Thanks, Ricardino. 5-star answer Smile . I'm grateful.

(And sorry, it was kind of lazy/stupid of me not to think of looking in the session library.)

Oh, and thanks, CodeIgniter, too - that seems to be the right way to do it. It would be a bit mean to log someone out after 2 hours even if they had been busily requesting new pages every 5 minutes...

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.