i have a problem when i want to get $_SESSION[\'session\']; in twig template using slim micro Framework.
this is my code :
This how I was able to achieve it with Slim Framework ver3
$container['view'] = function ($container) {
...
$view = new Twig($settings['view']['template_path'], $settings['view']['twig']);
$view->getEnvironment()->addGlobal('session', $_SESSION);
...
return $view;
};
And then access the session in the Twig template like