Better modified existence check
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 5 Nov 2010 23:05:13 +0000 (17:05 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 5 Nov 2010 23:05:13 +0000 (17:05 -0600)
framework/Core/lib/Horde/Session.php

index 1b66caa..60f2ca8 100644 (file)
@@ -106,8 +106,10 @@ class Horde_Session
             session_start();
 
             /* Create internal data arrays. */
-            if (!isset($_SESSION[self::SERIALIZED])) {
-                /* Last modification time of session. */
+            if (!isset($_SESSION[self::MODIFIED])) {
+                /* Last modification time of session.
+                 * This will cause the check below to always return true
+                 * (time() >= 0) and will set the initial value */
                 $_SESSION[self::MODIFIED] = 0;
 
                 /* Is this key serialized? */
@@ -123,7 +125,7 @@ class Horde_Session
              * we are accessing the server via a periodic mechanism (think
              * folder refreshing in IMP) that we will catch this refresh. */
             $curr_time = time();
-            if (!isset($_SESSION[self::MODIFIED]) || $curr_time >= $_SESSION[self::MODIFIED]) {
+            if ($curr_time >= $_SESSION[self::MODIFIED]) {
                 $_SESSION[self::MODIFIED] = intval($curr_time + (ini_get('session.gc_maxlifetime') / 2));
                 $this->sessionHandler->changed = true;
             }