public function has(string $key, $value = null): bool
    {
        return is_null($value)
            ? isset($_SESSION[$key])
            : isset($_SESSION[$key]) && $_SESSION[$key] == $value;
    }
public function has(string $key, $value = null): bool
    {
        return is_null($value)
            ? isset($_SESSION[$key])
            : isset($_SESSION[$key]) && $_SESSION[$key] == $value;
    }
public function has ( string $ key , $ value = null ) : bool { return is_null ( $ value ) ? isset ( $ _SESSION [ $ key ] ) : isset ( $ _SESSION [ $ key ] ) && $ _SESSION [ $ key ] == $ value ; }
Determines if the specified key exists in the current session. Optionally,
if the value argument is used, it also validates that the value is exactly
the one provided.

@param string $key
@param mixed $value
@return bool
Determines if the specified key exists in the current session . Optionally if the value argument is used it also validates that the value is exactly the one provided .