summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-12-18 05:20:06 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2013-12-18 05:20:06 -0800
commit9c5a620c4f54b2f53373a41fdf0407c929c39660 (patch)
treeff455da262f7a99dea2146a5b80dc762d304a0b4 /lib
parent3b4d49546bb851b488e8f6ed50d73322b5a2ee16 (diff)
parent5c7a08aab45a7f24086066549e1992f3dc2fdde6 (diff)
downloadnextcloud-server-9c5a620c4f54b2f53373a41fdf0407c929c39660.tar.gz
nextcloud-server-9c5a620c4f54b2f53373a41fdf0407c929c39660.zip
Merge pull request #6256 from owncloud/session-preserver-thirdparty
preserve 3rd party values in in the Session destructor
Diffstat (limited to 'lib')
-rw-r--r--lib/private/session/internal.php13
-rw-r--r--lib/private/session/memory.php2
2 files changed, 13 insertions, 2 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);
diff --git a/lib/private/session/memory.php b/lib/private/session/memory.php
index c148ff4b9b9..134cee582ed 100644
--- a/lib/private/session/memory.php
+++ b/lib/private/session/memory.php
@@ -11,7 +11,7 @@ namespace OC\Session;
/**
* Class Internal
*
- * store session data in an in-memory array, not persistance
+ * store session data in an in-memory array, not persistent
*
* @package OC\Session
*/