I have a Symfony2 app and I have to read the sessions set from another, non-symfony app.
The non-symfony app just set its sessions into $_SESSION, as usual.
However, when I attempt to read this session, the data isn't there. No matter I do it by
$session = $this->get('request')->getSession();
var_dump($session->all());
or even (I know I shouldn't do this, but anyway)
var_dump($_SESSION);
and this gives me session already started error, and I have no idea why there is error despite I have never started session in the Symfony app. Tells me if this way actually work so that I can look into session_start() thing.
$session = new Session();
$session->start();
var_dump($session->all());
The PHPSESSID cookie is set in the Symfony2 app and its value is the same as the cookie set in the non-symfony app, but my Symfony2 app just refuse to read the content of the session. ($session->getName() returns PHPSESSID, to be clear)
(To be exact, both apps are under same domain but different subdomains, and I have already set framework.session.domain correctly in app/config.yml in Symfony app and called session_set_cookie_params on the non-symfony app to have the same domain setting to allow sharing session cookie between subdomains i.e. .example.com)
So how do you read sessions in a Symfony2 app/Controller that is set by a non-symfony app? Thanks.
I am using Symfony 2.1, if this matters.