Hi James,

2011/6/16 James Pic <james...@gmail.com>:
> I was thinking of:
> $lastActivity = time() - $_SESSION[$this->options->lastActivityTimestampKey]
> if ( isset( $_SESSION[$this->options->lastActivityTimestampKey] ) &&
> $lastActivity >= $this->options->idleTimeout )
> What do you think ?
>

Then we would forced to do this :

$lastTimestampKey = false;
if ( isset( $_SESSION[$this->options->lastActivityTimestampKey] )
{
    $lastTimestampKey = $_SESSION[$this->options->lastActivityTimestampKey];
    $lastActivity = $now - $_SESSION[$this->options->lastActivityTimestampKey];
}

if ( $lastTimestampKey && $lastActivity >= $this->options->idleTimeout )
{
    $this->destroy();
    $this->regenerateId();
    return self::STATUS_EXPIRED;
}

I am not sure it is more readable, what do you think ?

Have a nice day :)

-- 
Jérôme Renard
http://39web.fr | http://jrenard.info | http://twitter.com/jeromerenard

Reply via email to