diff --git a/lib/private/Session/CryptoSessionData.php b/lib/private/Session/CryptoSessionData.php index df810d5b30c8d..1eb6987fc18f7 100644 --- a/lib/private/Session/CryptoSessionData.php +++ b/lib/private/Session/CryptoSessionData.php @@ -152,6 +152,7 @@ public function remove(string $key) { * Reset and recreate the session */ public function clear() { + $reopened = $this->reopen(); $requesttoken = $this->get('requesttoken'); $this->sessionValues = []; if ($requesttoken !== null) { @@ -159,6 +160,9 @@ public function clear() { } $this->isModified = true; $this->session->clear(); + if ($reopened) { + $this->close(); + } } public function reopen(): bool {