From 7d9f29aca734b3040ca5f7399782b997ef3eb2b4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 22 Aug 2005 20:24:53 +0000 Subject: - Patch #28629 by chx: fixed handling of cookies in drupal_http_request(). --- includes/common.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 2f6bed36b..33519b450 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -395,7 +395,14 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data = // Parse headers. while ($line = trim(array_shift($headers))) { list($header, $value) = explode(':', $line, 2); - $result->headers[$header] = trim($value); + if (isset($result->headers[$header]) && $header == 'Set-Cookie') { + // RFC 2109: the Set-Cookie response header comprises the token Set- + // Cookie:, followed by a comma-separated list of one or more cookies. + $result->headers[$header] .= ','. trim($value); + } + else { + $result->headers[$header] = trim($value); + } } $responses = array( -- cgit v1.2.3