Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.469
diff -u -F^f -r1.469 common.inc
@@ -395,7 +388,15 @@ function drupal_http_request($url, $head
   // 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.
+      // so it's OK to concat several cookies with a comma.
+      $result->headers[$header] .= ','. trim($value);
+    }
+    else {
+      $result->headers[$header] = trim($value);
+    }
   }
 
   $responses = array(
