fix bug in session class.

This commit is contained in:
Taylor Otwell 2011-11-07 22:43:57 -06:00
parent fefc202cb8
commit b9e91835ec
1 changed files with 2 additions and 4 deletions

View File

@ -38,7 +38,7 @@ public static function start(Driver $driver)
static::$session = $driver->load($id); static::$session = $driver->load($id);
} }
if (static::invalid()) if (is_null(static::$session) or static::invalid())
{ {
static::$exists = false; static::$exists = false;
@ -66,9 +66,7 @@ protected static function invalid()
{ {
$lifetime = Config::$items['session']['lifetime']; $lifetime = Config::$items['session']['lifetime'];
$idle = time() - static::$session['last_activity']; return (time() - static::$session['last_activity']) > ($lifetime * 60);
return is_null(static::$session) or ($idle > ($lifetime * 60));
} }
/** /**