How to share session between Symfony2 and Wordpress

I have a project built in Symfony2. I'm using FOSUserBundle to manage users. Now I have to integrate Wordpress into my project. Wordpress has to be available in subfolder: http://example.com/blog. I already managed to achieve such state, everything works like a charm, but now I need to share session between Symfony2 project and Wordpress. Actually I don't really know if session share is right solution to my problem. The thing is that I want to the same design in Wordpress as I use in Symfony project. In my Symfony project I have a top bar which indicates that user is authenticated. If user will authenticate via Symfony (I want it to be the only possible way) I want him to see that he is authenticated also while browsing the Wordpress blog. So session share was my first thought, but maybe there are other, more effective solutions? Maybe loading this top bar into iframe in Wordpress? Can EkinoWordpressBundle solve my problem?


If the WordPress installation is on the same domain in a folder, the session should be available trough PHP. You can check it by using the $_SESSION variable from PHP and add some code to your header.php to show the authentication details .

链接地址: http://www.djcxy.com/p/63152.html

上一篇: Nginx:在Symfony2应用程序的子文件夹中运行wordpress

下一篇: 如何在Symfony2和Wordpress之间共享会话