Not able to check if user is logged in magento system in footer.phtml file on some pages
I am not able to check if user is logged in or not in magento system. I need to check it in footer.phtml file and show the footer links accordingly. It is working in some of the pages but not in all pages. when i gone inside in the issue and printed session array it is not accessible in some pages and in other pages it is accessible.
I used below code to check if user is logged in the system or not.
Mage::getSingleton('customer/session')->isLoggedIn()
and
$this->helper('customer')->isLoggedIn()
But it return false in some pages but works in others.
and also when i gone inside the footer and开发者_StackOverflow社区 printed the current action and module name. it is showing module customer and action create where as address bar shows customer/somethingelse.
I am very surprised.
Please help.
Thanks.
Footers are cached blocks which exempts them from session data. You will need to either disable the HTML blocks cache completely or modify Mage_Page_Block_Html_Footer so it is not individually cached.
精彩评论