Browse Source

preserve 3rd party values in in the Session destructor

tags/v7.0.0alpha2
Robin Appelman 10 years ago
parent
commit
a36bf5c2b5
2 changed files with 11 additions and 2 deletions
  1. 10
    1
      lib/private/session/internal.php
  2. 1
    1
      lib/private/session/memory.php

+ 10
- 1
lib/private/session/internal.php View File

@@ -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);

+ 1
- 1
lib/private/session/memory.php View File

@@ -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
*/

Loading…
Cancel
Save