[icinga-checkins] icinga.org: icinga-web/r1.5: * Applied patch for db session handling ( THANKS TO Mr. Gelf) fixes #2061

git at icinga.org git at icinga.org
Thu Dec 1 14:08:23 CET 2011


Module: icinga-web
Branch: r1.5
Commit: c4414601e9b6688ce7fe77cd96f128bb9911ee08
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=c4414601e9b6688ce7fe77cd96f128bb9911ee08

Author: Marius Hein <marius.hein at netways.de>
Date:   Wed Nov 16 18:13:33 2011 +0100

* Applied patch for db session handling (THANKS TO Mr. Gelf) fixes #2061
* Reenabled DB session for parallel requests (fixes #2054, ref #2035)

---

 app/config/factories.xml                           |   15 +++++++++++++--
 .../storage/AppKitDoctrineSessionStorage.class.php |    3 ++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/app/config/factories.xml b/app/config/factories.xml
index 396b70c..769ea90 100644
--- a/app/config/factories.xml
+++ b/app/config/factories.xml
@@ -25,8 +25,19 @@
 		
 		<security_filter class="AgaviSecurityFilter" />
 		
-		<!-- Config for our session ... -->
-		<storage class="AgaviSessionStorage">
+		
+        <!--
+            * Session configuration
+            
+            - Choose between AppKitDoctrineSessionStorage and AgaviSessionStorage
+            - Database sessions are default again because of PHP session file locking
+              (Only one request per session)
+            - https://dev.icinga.org/issues/2061
+            - https://dev.icinga.org/issues/2035
+            - https://dev.icinga.org/issues/2054
+            
+        -->
+		<storage class="AppKitDoctrineSessionStorage">
 			<ae:parameter name="session_cookie_lifetime">0</ae:parameter>
 			<ae:parameter name="session_name">icinga-web</ae:parameter>
 			<ae:parameter name="gzip_level">6</ae:parameter>
diff --git a/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php b/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php
index ecd6dc2..0e47e92 100644
--- a/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php
+++ b/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php
@@ -68,7 +68,7 @@ class AppKitDoctrineSessionStorage extends AgaviSessionStorage {
         $this->getContext()->getLoggerManager()->log('Deleting sessions older that '. $date->format('c'), AgaviLogger::DEBUG);
 
         $result = Doctrine_Query::create()
-                  ->andWhere('session_created < ?', array($date->format('Y-m-d H:i:s')))
+                  ->andWhere('session_modified < ?', array($date->format('Y-m-d H:i:s')))
                   ->delete('NsmSession')
                   ->execute();
 
@@ -140,6 +140,7 @@ class AppKitDoctrineSessionStorage extends AgaviSessionStorage {
     public function sessionWrite($id, &$data) {
         $this->NsmSession->session_data = $data;
         $this->NsmSession->session_checksum = md5($data);
+        $this->NsmSession->session_modified = date('Y-m-d H:i:s');
         $this->NsmSession->save();
     }
 





More information about the icinga-checkins mailing list