Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Symfony uses the response object to set headers etc.
Most Drupal code doesn't have access to the response object, however we have a translation layer for http headers via #attached['http_header'].
This however doesn't work for cookies.
Proposed resolution
Consider something like #attached['cookie'] which then translates into a $response->addCookie()
Comments
Comment #2
dawehnerIn case we would do that, could we also somehow automatically create the corresponding cache contexts?
Comment #3
catch