Skip to content

Commit

Permalink
Merge pull request #751 from PennyDreadfulMTG/debug-sessions
Browse files Browse the repository at this point in the history
Don't store empty sessions, really this time
  • Loading branch information
bakert authored Sep 9, 2024
2 parents cad3d04 + 5e7867f commit 8c2f6e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gatherling/Auth/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ private static function save(): void
self::clear($token);
return;
}
if (empty($_SESSION)) {
return;
}
if (!$token) {
$token = bin2hex(random_bytes(32));
}
$details = json_encode($_SESSION);
if ($details === '[]') {
Log::warning('Storing an empty session for some reason', ['token' => $token, 'session' => $_SESSION]);
}
$expiry = time() + self::$LIFETIME;
$sql = '
INSERT INTO
Expand Down

0 comments on commit 8c2f6e9

Please sign in to comment.