Merge pull request #35723 from nextcloud/bugfix/35708

fix: Make sure to reopen session before cleaning
pull/35761/head
Vincent Petry 2022-12-20 17:25:09 +07:00 committed by GitHub
commit 761221bc80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

@ -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 {