Bug #9085: Only reset session ID once per page load
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 30 Jun 2010 20:34:46 +0000 (14:34 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 30 Jun 2010 20:34:46 +0000 (14:34 -0600)
framework/Core/lib/Horde/Registry.php

index b6e7007..1f99689 100644 (file)
@@ -43,6 +43,13 @@ class Horde_Registry
     protected $_regmtime;
 
     /**
+     * Indicate that a new session ID has been generated for this page load.
+     *
+     * @var boolean
+     */
+    protected $_cleansession = false;
+
+    /**
      * Stack of in-use applications.
      *
      * @var array
@@ -1587,6 +1594,10 @@ class Horde_Registry
      */
     public function getCleanSession()
     {
+        if ($this->_cleansession) {
+            return;
+        }
+
         // Make sure to force a completely new session ID and clear all
         // session data.
         session_regenerate_id(true);
@@ -1601,6 +1612,8 @@ class Horde_Registry
             }
             $secret->setKey('auth');
         }
+
+        $this->_cleansession = true;
     }
 
     /**