fixup! fix(session): Make session encryption more robust

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2025-01-10 15:09:58 +01:00
parent 5c5e26edf5
commit f99c08987e
No known key found for this signature in database
GPG key ID: CC42AC2A7F0E56D8

View file

@ -83,18 +83,23 @@ class Internal extends Session {
* @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() {