How to show or access cookie values in Symfony Twig views

Strange how obscure it is to find a clear example of how to just access or show the value of a cookie in Twig, so here it is!

Twig is the templating engine that powers Symfony views.  Symfony is the PHP framework from Sensio Labs.

If you are a company that uses open-source software and developers and you are not using a PHP framework, you should consider migrating your legacy “cowboy” code to a collaborative, scalable framework like Symfony before it becomes a necessity for your company.  I have overseen many migrations of systems and data over the years and am available for consultation at my business consulting site at

– Aaron Belchamber

Aaron Belchamber has written 247 articles

Leave a Reply

Your email address will not be published. Required fields are marked *