public function addCookieHeaders(RequestInterface $request): RequestInterface
    {
        $cookies = [];
        foreach ($this->getCookies() as $cookie) {
            if ($cookie->matchesRequest($request)) {
                $cookies[] = $cookie->toCookieHeader();
            }
        }
        if ($cookies) {
            $request = $request->withAddedHeader('Cookie', implode('; ', $cookies));
        }

        return $request;
    }