public function setCookie($key, $value)
    {
        if (is_null($key)) {
            $this->cookies[] = $value;
        } else {
            $this->cookies[$key] = $value;
        }

        return $this;
    }
public function setCookie($key, $value)
    {
        if (is_null($key)) {
            $this->cookies[] = $value;
        } else {
            $this->cookies[$key] = $value;
        }

        return $this;
    }
public function setCookie ( $ key , $ value ) { if ( is_null ( $ key ) ) { $ this -> cookies [ ] = $ value ; } else { $ this -> cookies [ $ key ] = $ value ; } return $ this ; }
Define a cookie

@param null|string $key
@param string $value

@return $this
@throws \InvalidArgumentException
Define a cookie