Does anyone know how to access the session variable in a service?
I have a service setup that I pass the container over to. I can access things like the Doctrine service by using:
// Get the doctrine service $doctrine_service = $this->container->get('doctrine'); // Get the entity manager $em = $doctrine_service->getEntityManager();
However, I'm not sure how to access the session.
In a controller the session can be accessed using:
$session = $this->getRequest()->getSession(); $session->set('foo', 'bar'); $foo = $session->get('foo');
Is the session part of a service and if so what is the service called.
Any help would be really appreciated.