public function cookies($request)
    {
        $headers = $response->headers();
        if (!isset($headers['Set-Cookie'])) {
            return [];
        }
        $setCookies = [];
        foreach ($headers['Set-Cookie'] as $setCookieHeader) {
            $setCookie = Cookie::fromString($setCookieHeader);
            if (!$setCookie->domain()) {
                $setCookie->domain($request->hostname());
            }
            if (strpos($setCookie->path(), '/') !== 0) {
                $setCookie->path($this->_pathFrom($request));
            }
            $setCookies[] = $setCookie;
        }
        return $setCookies;
    }