Sorry if this question has been asked before I could not find it. I couldn't find the answer I was looking for.
I have a legacy application that I'm rebuilding with Symfony2, unfortunatly I need to run parallel for a while until I can finish rebuilding the entire system. I'm to the part where I need to have symfony be able to access the legacy session data to be able to function.
I found this from the Symfony site: http://symfony.com/doc/current/cookbook/session/php_bridge.html http://symfony.com/doc/current/components/http_foundation/session_php_bridge.html
But I dont understand were the configuration needs to happen and where Im supposed to call the session-start and also how to access the session data from my new application.
Would I be placing the example given in symfony in every controller I create?
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage;
// legacy application configures session
ini_set('session.save_handler', 'files');
ini_set('session.save_path', '/tmp');
session_start();
// Get Symfony to interface with this existing session
$session = new Session(new PhpBridgeSessionStorage());
// symfony will now interface with the existing PHP session
$session->start();
Seems like there should be a way to centralize it.
UPDATE The manual gives an example but It doesn't say if its supposed to go in a controller, service, entity, or config somewhere.
I tried using the example code in a controller and when I do a print_r on the $session I don't see any legacy session data.
**
Thanks in advance.