Browse Source

fix bug in session class.

Taylor Otwell 13 years ago
parent
commit
b9e91835ec
1 changed files with 2 additions and 4 deletions
  1. 2 4
      laravel/session.php

+ 2 - 4
laravel/session.php

@@ -38,7 +38,7 @@ class Session {
 			static::$session = $driver->load($id);
 		}
 
-		if (static::invalid())
+		if (is_null(static::$session) or static::invalid())
 		{
 			static::$exists = false;
 
@@ -66,9 +66,7 @@ class Session {
 	{
 		$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);
 	}
 
 	/**