src/Leevel/Http/Cookie.php
public function get(string $name, $defaults = null, array $option = [])
    {
        $option = $this->normalizeOptions($option);

        if (isset($this->cookies[$name])) {
            if ($this->isJson($this->cookies[$name][1])) {
                return json_decode($this->cookies[$name][1], true);
            }

            return $this->cookies[$name][1];
        }

        return $defaults;
    }
public function get(string $name, $defaults = null, array $option = [])
    {
        $option = $this->normalizeOptions($option);

        if (isset($this->cookies[$name])) {
            if ($this->isJson($this->cookies[$name][1])) {
                return json_decode($this->cookies[$name][1], true);
            }

            return $this->cookies[$name][1];
        }

        return $defaults;
    }
获取 cookie.

@param string $name
@param mixed  $defaults
@param array  $option

@return mixed