Get cookie from Twig template
Twig
has the global app
helper context, via which you can access the cookies (among other things). Try this:
{{ dump(app.request.cookies) }}
And ultimately:
{{ app.request.cookies.get('MY_COOKIE_NAME') }}
Remember, cookies
is an instance of ParameterBag
(API), so you have to access it via get()
call.
Hope this helps...