/** * Removes the specified cookie from the headers of this message, if it exists * * This is a shortcut for $message->getHeaders()->removeCookie($name); * * @param string $name Name of the cookie to remove * @return void * @api */ public function removeCookie($name) { $this->headers->removeCookie($name); }
/** * @test */ public function cookiesCanBeRemoved() { $headers = new Headers(); $headers->setCookie(new Cookie('Dark-Chocolate-Chip')); $this->assertTrue($headers->hasCookie('Dark-Chocolate-Chip')); $headers->removeCookie('Dark-Chocolate-Chip'); $this->assertFalse($headers->hasCookie('Dark-Chocolate-Chip')); }