Skip to content
Snippets Groups Projects
Commit a36bf5c2 authored by Robin Appelman's avatar Robin Appelman
Browse files

preserve 3rd party values in in the Session destructor

parent bc3650e4
No related branches found
No related tags found
No related merge requests found
......@@ -26,10 +26,19 @@ 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
unset($_SESSION[$key]);
parent::remove($key);
}
public function clear() {
session_unset();
@session_regenerate_id(true);
......
......@@ -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
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment