diff --git a/src/Session.php b/src/Session.php index db353a9..da86755 100644 --- a/src/Session.php +++ b/src/Session.php @@ -222,8 +222,8 @@ public static function sessionStart(): bool } static::$sessionStarted = true; // Check session file path - if (isset($_COOKIE[HttpCache::$sessionName]) && !\preg_match('/^[a-zA-Z0-9]+$/', $_COOKIE[HttpCache::$sessionName])) { - unset($_COOKIE[HttpCache::$sessionName]); + if (isset($_COOKIE[static::$sessionName]) && !\preg_match('/^[a-zA-Z0-9]+$/', $_COOKIE[static::$sessionName])) { + unset($_COOKIE[static::$sessionName]); } // Generate a SID. if (! isset($_COOKIE[static::$sessionName]) || ! \is_file(static::$sessionSavePath.'/ses_'.$_COOKIE[static::$sessionName])) {