/** * @covers Guzzle\Http\QueryString * @covers Guzzle\Http\Cookie */ public function testAggregatesMultipleCookieValues() { $cookie = Cookie::factory('name=a;name=b'); $this->assertEquals(array('a', 'b'), $cookie->get('name')); $this->assertEquals('name=a;name=b', (string) $cookie); }
/** * {@inheritdoc} */ protected function changedHeader($action, $header) { parent::changedHeader($action, $header); if ($header === 'host') { // If the Host header was changed, be sure to update the internal URL $this->setHost((string) $this->getHeader('Host')); } elseif ($header === 'cookie') { // Be sure to get an cookie updates and update the internal Cookie if ($action === 'set') { $this->cookie = Cookie::factory($this->getHeader('Cookie')); } else { if ($this->cookie) { $this->cookie->clear(); } } } }