Skip to content

Commit

Permalink
Merge pull request #750 from PennyDreadfulMTG/debug-sessions
Browse files Browse the repository at this point in the history
Debug an issue with storing empty sessions
  • Loading branch information
bakert authored Sep 9, 2024
2 parents c4006d6 + a4ab3cb commit cad3d04
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gatherling/Auth/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Gatherling\Auth;

use Gatherling\Data\DB;
use Gatherling\Log;

class Session
{
Expand Down Expand Up @@ -54,6 +55,9 @@ private static function save(): void
$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 cad3d04

Please sign in to comment.