PHP Symfony: Access the internationalization “locale”

In your controller, you can access the special global "_locale" variable from the Request object:  

Accessing cookies directly in your Symfony Twig views

In Symfony, cookies are stored in the app.request object. Here's how you access them in Twig: To see if a cookie is set, use the if statement inside Twig: