creates the cookie

@param   string  $name   name of the cookie
@param   string  $value  value of the cookie
@return  \stubbles\webapp\response\Cookie
164812
public static function create(string $name, string $value = null): self
    {
        return new self($name, $value);
    }
1308887
public final static void addCookie(String name, String value) {
		getServletResponse().addCookie(new Cookie(name, value));
	}
423023
public function setHeader(string $name, string $value)
    {
        switch ($this->type) {
            case 'psr-7':
                $this->response = $this->response->withHeader($name, $value);
                break;

            case 'laravel':
            case 'symfony':
                $this->response->headers->set($name, $value);
                break;

            case 'thinkphp':
                $this->response->header($name, $value);
                break;

            default:
                $this->response[$name] = $value;
                break;
        }

        return $this;
    }
1273593
public function cookie($name, $value=null) 
    {
        $str = '';
        if (is_array($name)) {
            $arr = [];
            foreach ($name as $k=>$v) {
                $arr[] = $k . '=' . $v;
            }
            $str = implode(';', $arr);
        } elseif ($value) {
            $str = $name . '=' . $value;
        } else {
            $str = $name;
        }
        
        $this->def['cookie'] = $this->def['cookie'] ? $this->def['cookie'].';'.$str : $str;

        return $this;
    }
412130
public function addCookie($name, $value, $expire = null, $path = null)
    {
        $this->cookies[$name] = [
            'value' => $value,
            'expire' => $expire,
            'path' => $path
        ];
        return $this;
    }
486498
public HttpResponse withCookie(String name, String value) {
        this.cookies.withEntry(name, value);
        return this;
    }
398447
public function set($name, $value, $path = null, $domain = null, $isSecure = null, \DateTime $expiry = null)
    {
        $cookie = new Cookie($name, $value, $path, $domain, $isSecure, $expiry);

        $this->setCookie($cookie);
    }
351310
public function withHeader($name, $value)
    {
        $new = clone $this;
        $name = $this->normalizeHeaderName($name);
        $new->_environment[$name] = $value;

        return $new;
    }
1259536
protected function setCookie($name, $value = null)
    {
        if ($value !== null) {
            $this->cookie[$name] = $value;
        } elseif (isset($this->cookie[$name])) {
            unset($this->cookie[$name]);
        }
    }
64318
public function set_cookie($name, $value = null)
	{
		is_null($value)
			? $this->connection()->__setCookie($name)
			: $this->connection()->__setCookie($name, $value);
	}
1316985
public function &createCookie(string $name)
    {
        $cookie = new Cookie();
        $cookie->setName($name);

        $this->addCookie($cookie);

        return $cookie;
    }
788687
public function withCookie($name, $value, $expire = 0, $path = '/', $domain = null, $secure = null, $httponly = true)
    {
        if (null === $secure) {
            $secure = isset($_SERVER['HTTPS']) ? (bool) $_SERVER['HTTPS'] : false;
        }

        $key = sprintf('%s@%s:%s', $name, $domain, $path);
        $this->cookies[$key] = [$name, $value, $expire, $path, $domain, $secure, $httponly];

        return $this;
    }
875690
public function set(string $name, string $value)
    {
        $this->values[$name] = $value;
        return $this;
    }
97029
public function addHeader(string $name, $value)
    {
        parent::addHeader($name, $value);

        if (\stripos($name, "cookie") === 0) {
            $this->setCookiesFromHeaders();
        }
    }
406850
public function cookie($value)
    {
        if (!isset($this->cookie[$value])) {
            return false;
        } else {
            return $this->cookie[$value];
        }
    }
711448
protected function duplicate(Cookie $cookie, $value)
    {
        return new Cookie(
            $cookie->getName(), $value, $cookie->getExpiresTime(),
            $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(),
            $cookie->isHttpOnly(), $cookie->isRaw(), $cookie->getSameSite()
        );
    }
379082
public function withHeader($name, $value)
    {
        $request = clone $this;
        $request->headers->set($name, $value);

        return $request;
    }