mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-08 04:22:40 +00:00
Add support for key => value cookies.
This makes using simple arrays easier, and I feel it is a long standing omission from HttpSocket. Fixes #3771
This commit is contained in:
parent
d01d291d13
commit
4d8dd12449
2 changed files with 9 additions and 3 deletions
|
@ -942,7 +942,12 @@ class HttpSocket extends CakeSocket {
|
|||
public function buildCookies($cookies) {
|
||||
$header = array();
|
||||
foreach ($cookies as $name => $cookie) {
|
||||
$header[] = $name . '=' . $this->_escapeToken($cookie['value'], array(';'));
|
||||
if (is_array($cookie)) {
|
||||
$value = $this->_escapeToken($cookie['value'], array(';'));
|
||||
} else {
|
||||
$value = $this->_escapeToken($cookie, array(';'));
|
||||
}
|
||||
$header[] = $name . '=' . $value;
|
||||
}
|
||||
return $this->_buildHeader(array('Cookie' => implode('; ', $header)), 'pragmatic');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue