summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcmail.php4
-rw-r--r--program/include/rcube_session.php13
2 files changed, 16 insertions, 1 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 980efe43d..d9bb30bbe 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -1078,8 +1078,10 @@ class rcmail
$this->imap->close();
// before closing the database connection, write session data
- if ($_SERVER['REMOTE_ADDR'])
+ if ($_SERVER['REMOTE_ADDR']) {
+ $this->session->cleanup();
session_write_close();
+ }
// write performance stats to logs/console
if ($this->config->get('devel_mode')) {
diff --git a/program/include/rcube_session.php b/program/include/rcube_session.php
index 1fa331753..8c7adb3f1 100644
--- a/program/include/rcube_session.php
+++ b/program/include/rcube_session.php
@@ -192,6 +192,19 @@ class rcube_session
/**
+ * Cleanup session data before saving
+ */
+ public function cleanup()
+ {
+ // current compose information is stored in $_SESSION['compose'], move it to $_SESSION['compose_data']
+ if ($_SESSION['compose']) {
+ $_SESSION['compose_data'][$_SESSION['compose']['id']] = $_SESSION['compose'];
+ $this->remove('compose');
+ }
+ }
+
+
+ /**
* Register additional garbage collector functions
*
* @param mixed Callback function