Skip to content
Permalink
Browse files

Setting cookies in a single line. Fixes #48

  • Loading branch information...
jrbasso committed Jun 23, 2010
1 parent 5945edd commit 9bbaf153f77b15f190b027065e03b78e0dc1f00e
Showing with 2 additions and 2 deletions.
  1. +1 −1 cake/libs/http_socket.php
  2. +1 −1 cake/tests/cases/libs/http_socket.test.php
@@ -975,7 +975,7 @@ function buildCookies($cookies) {
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;
}
@@ -1375,7 +1375,7 @@ function testBuildCookies() {
'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);
}

0 comments on commit 9bbaf15

Please sign in to comment.
You can’t perform that action at this time.