aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/session/internal.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/session/internal.php')
-rw-r--r--lib/private/session/internal.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/private/session/internal.php b/lib/private/session/internal.php
index 60aecccc8aa..a7c9e2fdefd 100644
--- a/lib/private/session/internal.php
+++ b/lib/private/session/internal.php
@@ -26,10 +26,21 @@ class Internal extends Memory {
}
public function __destruct() {
- $_SESSION = $this->data;
+ $_SESSION = array_merge($_SESSION, $this->data);
session_write_close();
}
+ /**
+ * @param string $key
+ */
+ public function remove($key) {
+ // also remove it from $_SESSION to prevent re-setting the old value during the merge
+ if (isset($_SESSION[$key])) {
+ unset($_SESSION[$key]);
+ }
+ parent::remove($key);
+ }
+
public function clear() {
session_unset();
@session_regenerate_id(true);