sensio/SensioFrameworkExtraBundle — pull request #105 by olegstepura (2012-03-15 16:25:14+00:00)
Title: [TemplateListener] Add possibility to add cookies to Response in a controller when using @Template annotation

Since when `@Template` annotation is used controller action method returns array - there is *no way* to add cookies to the response. I propose a solution to add precreated empty Response to `_response` attribute of the request which is then used when `TemplateListener` starts it's work.

Now you can use `$this->getRequest()->attributes->get('_response')->headers->setCookie(new Cookie('test', 123))` in a controller.