Skip to content

Commit

Permalink
fixup! fix(session): Make session encryption more robust
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst committed Jan 10, 2025
1 parent 5c5e26e commit f99c089
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/private/Session/Internal.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,23 @@ public function exists(string $key): bool {
* @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() {
Expand Down

0 comments on commit f99c089

Please sign in to comment.