Setting cookies in a single line. Fixes #48

This commit is contained in:
Juan Basso 2010-06-23 00:10:21 -03:00
parent 5945edd983
commit 9bbaf153f7
2 changed files with 2 additions and 2 deletions

View file

@ -975,7 +975,7 @@ class HttpSocket extends CakeSocket {
foreach ($cookies as $name => $cookie) {
$header[] = $name.'='.$this->_escapeToken($cookie['value'], array(';'));
}
$header = $this->_buildHeader(array('Cookie' => $header), 'pragmatic');
$header = $this->_buildHeader(array('Cookie' => implode('; ', $header)), 'pragmatic');
return $header;
}

View file

@ -1375,7 +1375,7 @@ class HttpSocketTest extends CakeTestCase {
'path' => '/accounts'
)
);
$expect = "Cookie: foo=bar\r\nCookie: people=jim,jack,johnny\";\"\r\n";
$expect = "Cookie: foo=bar; people=jim,jack,johnny\";\"\r\n";
$result = $this->Socket->buildCookies($cookies);
$this->assertEqual($result, $expect);
}