diff --git a/httpclient.php b/httpclient.php index f6b235f..44f258e 100644 --- a/httpclient.php +++ b/httpclient.php @@ -543,7 +543,7 @@ class Httpclient $cookies = $this->cookieToSend ($this->url); if (! empty ($cookies)) { - $this->headersSent[] = "Cookie: ".implode ("; ", $cookies); + $this->headersSent["Cookie"] = implode ("; ", $cookies); } if ($this->method !== "GET" && ! empty ($this->formData)) { @@ -730,6 +730,9 @@ class Httpclient $content = gzdecode ($content); } $this->disconnect (); + $this->headersReset (); + $this->formData = ""; + $this->rawData = ""; if ($this->httpCode === 301 || $this->httpCode === 302 || key_exists ("Location", $this->headersReceived)) {