]> git.donarmstrong.com Git - roundcube.git/blobdiff - program/include/rcube_session.php
Merge commit 'upstream/0.7'
[roundcube.git] / program / include / rcube_session.php
index 01b93670cfe93a9943a574ef18191f94d015e276..bd0ce60e46f2eb2d948a0a0d3af1ce06b157f04b 100644 (file)
@@ -6,6 +6,7 @@
  |                                                                       |
  | This file is part of the Roundcube Webmail client                     |
  | Copyright (C) 2005-2011, The Roundcube Dev Team                       |
+ | Copyright (C) 2011, Kolab Systems AG                                  |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -330,20 +331,7 @@ class rcube_session
   public function gc()
   {
     foreach ($this->gc_handlers as $fct)
-      $fct();
-  }
-
-
-  /**
-   * Cleanup session data before saving
-   */
-  public function cleanup()
-  {
-    // current compose information is stored in $_SESSION['compose'], move it to $_SESSION['compose_data_<ID>']
-    if ($compose_id = $_SESSION['compose']['id']) {
-      $_SESSION['compose_data_'.$compose_id] = $_SESSION['compose'];
-      $this->remove('compose');
-    }
+      call_user_func($fct);
   }
 
 
@@ -403,6 +391,21 @@ class rcube_session
   }
 
 
+  /**
+   * Re-read session data from storage backend
+   */
+  public function reload()
+  {
+    if ($this->key && $this->memcache)
+      $data = $this->mc_read($this->key);
+    else if ($this->key)
+      $data = $this->db_read($this->key);
+
+    if ($data)
+     session_decode($data);
+  }
+
+
   /**
    * Serialize session data
    */