diff --git a/includes/common.inc b/includes/common.inc index 2f6bed36bb5..33519b450c5 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(