mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
fixup! fix(session): Make session encryption more robust
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
5c5e26edf5
commit
f99c08987e
1 changed files with 8 additions and 3 deletions
|
|
@ -83,18 +83,23 @@ class Internal extends Session {
|
|||
* @param string $key
|
||||
*/
|
||||
public function remove(string $key) {
|
||||
if (isset($_SESSION[$key])) {
|
||||
unset($_SESSION[$key]);
|
||||
$reopened = $this->reopen();
|
||||
unset($_SESSION[$key]);
|
||||
if ($reopened) {
|
||||
$this->close();
|
||||
}
|
||||
}
|
||||
|
||||
public function clear() {
|
||||
$this->reopen();
|
||||
$reopened = $this->reopen();
|
||||
$this->invoke('session_unset');
|
||||
$this->regenerateId();
|
||||
$this->invoke('session_write_close');
|
||||
$this->startSession(true);
|
||||
$_SESSION = [];
|
||||
if ($reopened) {
|
||||
$this->close();
|
||||
}
|
||||
}
|
||||
|
||||
public function close() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue