我需要检查用户是否已注册并获取您的信息,但所有信息都在同一域内但在 Magento 结构之外的文件中:/mymagento/islogged.php
require_once ('app/Mage.php');
Mage::app();
define('ROOT', Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB));
$sessionCustomer = Mage::getSingleton("customer/session");
if($sessionCustomer->isLoggedIn()) {
$customer = $sessionCustomer->getCustomer();
$telefono = $customer->getTelefonoMovil();
} else {
header('Location: '.ROOT.'customer/account/login/');
}
但它不起作用,找不到会话。我审查了以下主题: