Permalink
Browse files

Setting cookies in a single line. Fixes #48

  • Loading branch information...
1 parent 6fa4ce5 commit 637ab82a48cb330e75eae2c9a362c456ca444da6 @jrbasso jrbasso committed Jun 23, 2010
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
@@ -890,7 +890,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;
}
/**
@@ -1228,7 +1228,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 637ab82

Please sign in to comment.