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

$request = $this->get('request');

$locale= $request->getLocale();

 


In Symfony, cookies are stored in the app.request object. Here’s how you access them in Twig:

{% app.request.cookies %}


To see if a cookie is set, use the if statement inside Twig:

{% if app.request.cookies.has('yourCookie') %}
  Cookie 'yourCookie' has been set.  {{ app.request.cookies.get('yourCookie') }} 
{% endif %}