开发者

magento cookies not working

I'm using

$id = 'WelcomeWindow';
$data = '1';
$time = time()+60*60*24*30;
Mage::getModel('core/cookie')-&开发者_JAVA百科gt;set($id, $data, $time);

And to get the cookie back

$data_from_cookie = Mage::getModel('core/cookie')->get('WelcomeWindow');

This kind of works but - when getting the cookie it doesn't show the value untill I refersh the Magento Cache within the admin area, is there a way around this?


I've sorted it, for some reason I've moved the code to be executed before anything else is delivered to the page, so I placed it at the top of head.phtml and it seems to work fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜