Magento:如何在前端获取访问者的cookie或会话ID [英] Magento: How to get visitor's cookies or session Id on front end
本文介绍了Magento:如何在前端获取访问者的cookie或会话ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想为网站上的每个访问者记录最近查看的产品.为此,我相信最好的方法是通过其Cookie/会话ID对其进行记录.如何获取未登录的访问者的会话ID/Cookies.
I want to log the recently viewed product for every visitor on the site. And for that the best way I believe is to log it via their cookie/session ID. How can I get the Session ID/Cookies of a visitor who is not logged in.
谢谢
推荐答案
您可以通过session
$vistitorId = Mage::getModel('core/session')->getVisitorId();
这篇关于Magento:如何在前端获取访问者的cookie或会话ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文