src/Request.php
public function cookie($key = null, $value = null)
    {
        if (is_array($key))
        {
            $this->_cookies = $key;

            return $this;
        }
        elseif (null === $key)
        {
            return $this->_cookies;
        }
        elseif (null === $value)
        {
            return isset($this->_cookies[$key]) ? $this->_cookies[$key] : null;
        }

        $this->_cookies[$key] = (string) $value;
        return $this;
    }
public function cookie($key = null, $value = null)
    {
        if (is_array($key))
        {
            $this->_cookies = $key;

            return $this;
        }
        elseif (null === $key)
        {
            return $this->_cookies;
        }
        elseif (null === $value)
        {
            return isset($this->_cookies[$key]) ? $this->_cookies[$key] : null;
        }

        $this->_cookies[$key] = (string) $value;
        return $this;
    }
设置或者读取cookie

@param  mixed  $key   Cookie名，或一个cookie数组
@param  string $value 值
@return string
@return mixed