symfony/symfony — Issue #3092: Add copyCookies function to Response
Author: Elfet
Created: 2012-01-11 13:36:55+00:00
State: open

Hello!
Why it's so difficult to copy Cookie from Response to RedirectResponse? Create some method for it!

```php
public function copyCookies(Response $response)
{
$cookies = $response->headers->getCookies(ResponseHeaderBag::COOKIES_ARRAY);
foreach ($cookies as $domain)
foreach ($domain as $path)
foreach ($path as $name => $cookie)
$this->headers->setCookie($cookie);
}
```

also add isSended function to response.