Skip to content

Commit

Permalink
fix destroy redis session handler (#4471)
Browse files Browse the repository at this point in the history
  • Loading branch information
aynsix authored Feb 9, 2024
1 parent 9927b4d commit 63431bf
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/Alchemy/Phrasea/Utilities/RedisSessionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,21 @@ public function write($sessionId, $data)
*/
public function destroy($sessionId)
{
return 1 === $this->redis->del($this->prefix.$sessionId);
static $unlink = true;

if ($unlink) {
try {
$unlink = false !== $this->redis->unlink($this->prefix.$sessionId);
} catch (\Throwable $e) {
$unlink = false;
}
}

if (!$unlink) {
$this->redis->del($this->prefix.$sessionId);
}

return true;
}

/**
Expand Down

0 comments on commit 63431bf

Please sign in to comment.