I tried: {% set foo = get_cookie('MY_COOKIE') %} <p>var: {{foo}}</p>
But it’s not working. Is this function retrieve a cookie from the header response of the page or a cookie previously set by the front-end (JS) for example?
Basically I need to read some cookies from a response header OR to read headers directly, is there a way to accomplish that?
As written in Twitter, to me it works, with a simple numeric cookie. Could it be that the implementation of get_cookie as linked above is filtering it? Post more information, what’s the content of the cookie, how are you calling it in your twig?