I have a magento shop and for testing purposes I use a subdomain
www.example.com/shop -> shop
test.example.com/ ->subdomain
I am trying to access the Magento session from the subdomain with the following code (test.php)
require_once 'shop/app/Mage.php';
umask(0);
Mage::app();
Mage::getSingleton('core/session', array('name' => 'frontend'));
var_dump(Mage::getSingleton('customer/session')->isLoggedIn());
Like in this question and in this question and following the Magento Wiki I set the Cookie Path to
/
and the Cookie Domain to
.example.com
Still the test.example.com/test.php returns false. Also this logs me out somehow. So when refreshing the shop in another tab, the user is logged out. When testing the same file from www.example.com/test.php everything works fine.
What else could be the problem in my case? Any suggestions?