fix bug in session class.
This commit is contained in:
parent
fefc202cb8
commit
b9e91835ec
|
@ -38,7 +38,7 @@ public static function start(Driver $driver)
|
|||
static::$session = $driver->load($id);
|
||||
}
|
||||
|
||||
if (static::invalid())
|
||||
if (is_null(static::$session) or static::invalid())
|
||||
{
|
||||
static::$exists = false;
|
||||
|
||||
|
@ -66,9 +66,7 @@ protected static function invalid()
|
|||
{
|
||||
$lifetime = Config::$items['session']['lifetime'];
|
||||
|
||||
$idle = time() - static::$session['last_activity'];
|
||||
|
||||
return is_null(static::$session) or ($idle > ($lifetime * 60));
|
||||
return (time() - static::$session['last_activity']) > ($lifetime * 60);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue