Merge pull request #35723 from nextcloud/bugfix/35708

fix: Make sure to reopen session before cleaning
This commit is contained in:
Vincent Petry 2022-12-20 17:25:09 +01:00 committed by GitHub
commit 761221bc80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -152,6 +152,7 @@ class CryptoSessionData implements \ArrayAccess, ISession {
* Reset and recreate the session
*/
public function clear() {
$reopened = $this->reopen();
$requesttoken = $this->get('requesttoken');
$this->sessionValues = [];
if ($requesttoken !== null) {
@ -159,6 +160,9 @@ class CryptoSessionData implements \ArrayAccess, ISession {
}
$this->isModified = true;
$this->session->clear();
if ($reopened) {
$this->close();
}
}
public function reopen(): bool {