Add a Cookie value by name to the Cookie header
string $name Name of the cookie to add:
string $value Value to set:
Overrides RequestInterface::addCookie
public function addCookie($name, $value) {
if (!$this
->hasHeader('Cookie')) {
$this
->setHeader('Cookie', "{$name}={$value}");
}
else {
$this
->getHeader('Cookie')
->add("{$name}={$value}");
}
// Always use semicolons to separate multiple cookie headers
$this
->getHeader('Cookie')
->setGlue('; ');
return $this;
}