I\'ve searched a lot on the net how to access the global $_SESSION array from TWIG template and found this: {{app.session.get(\'index\')}}, but whe
$_SESSION
{{app.session.get(\'index\')}}
Setup twig
$twig = new Twig_Environment(...); $twig->addGlobal('session', $_SESSION);
Then within your template access session values for example
$_SESSION['username'] in php file Will be equivalent to {{ session.username }} in your twig template