I have installed Magento 1.9.x on the root directory of the server and WordPress installed under blog directory(/blog).
I need to show cart item count and my-account link(if customer is logged in Magento) on the header of the blog(WordPress).
I also tried many available solutions like access customer session outside Magento, but nothing works for me.
require_once ("/var/www/magento_pack/app/Mage.php");
umask(0);
Mage::app("default");
Mage::app()->loadArea('frontend');
Mage::getSingleton('core/session', array('name' => 'frontend'));
if(Mage::getSingleton('customer/session')->isLoggedIn())
echo Mage::getSingleton('customer/session')->getId();
else
echo 'Not logged in';
exit;
Any suggestions?