【发布时间】:2015-04-03 17:38:18
【问题描述】:
我必须在 magento 之外的文件中读取$_SESSION['name'],或者更好的是在 /magento/folder 中。
我尝试了任何解决方案都没有好的结果。
例子
Mage::getSingleton('core/session')->setUName($_SESSION['username']);
在外部文件中使用此代码:
require_once("../app/Mage.php");
umask(0);
Mage::app();
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
Mage::init();
$_SESSION['username'] = Mage::getSingleton('core/session')->getUName();
结果???变量为空......
我对 magento 很着迷……我需要这个变量!!!!
如果有人可以帮助我,我会说声谢谢。
【问题讨论】:
标签: php magento variables session magento-1.9