Skip to content

Commit a6761d7

Browse files
committed
fix: Make sure to reopen session before cleaning
Otherwise restoring the requesttoken would reopen and read the existing session data and restore it instead of clearing Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent 8d1142c commit a6761d7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/private/Session/CryptoSessionData.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,17 @@ public function remove(string $key) {
152152
* Reset and recreate the session
153153
*/
154154
public function clear() {
155+
$reopened = $this->reopen();
155156
$requesttoken = $this->get('requesttoken');
156157
$this->sessionValues = [];
157158
if ($requesttoken !== null) {
158159
$this->set('requesttoken', $requesttoken);
159160
}
160161
$this->isModified = true;
161162
$this->session->clear();
163+
if ($reopened) {
164+
$this->close();
165+
}
162166
}
163167

164168
public function reopen(): bool {

0 commit comments

Comments
 (0)