One part of our website will be built using Symfony the other Magento. I would like to know if it is possible to share user session variables between two of them.
Thank you!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
After much trial and error I created the following work around. This is based on a situation where the login is managed by a platform other than Magento.
I was not able to find a way to share a session with Magento that was initialized outside of Magento. Instead I created a simple Magento extension that hooks to the event observer ‘http_response_send_before’.
Now whenever Magento loads a page, the module will check to see if the user is logged in to the other system. If so, it retrieves the email of that user, and logs the user into Magento using the email address as the identifier, and sets the session for that customer. Obviously the customer must already exist in Magento for the login to work.
Here are the files and the code contained within. Feel free to modify to work with your system.
/app/code/local/Verve/Session/etc/config.xml
/app/code/local/Verve/Session/Helper/Login.php
/app/etc/modules/Verve_Session.xml