访问magento文件中的会话变量


Accessing session variable inside magento files

我有一个自定义文件,我在其中使用会话来存储变量,我需要访问magento文件中的这些变量。我的自定义文件夹结构magento/custom/checkmail.php我需要访问magento文件中的会话变量,即。magento/app/design/frontend/base/default/template/ppersistent/customer/form/login.phtml我已经在magento文件login.phtml中启动了会话。但值没有传递给它。它传递的是"null"值。我该怎么办?

如何在会话中保存值试试这个

$session = Mage::getSingleton("core/session",  array("name"=>"frontend"));
$session->setData("custom_field", 'custom value');
$yourValue = $session->getData("custom_field");

checkmail中,像这样写

$session = Mage::getSingleton("core/session",  array("name"=>"frontend"));
        // set data in session start //
        $session->setData("orderid", $data['orderid']);

并且在CCD_ 2中得到类似于这个的值

// Getting values from session which was set during url checking
    $session = Mage::getSingleton("core/session",  array("name"=>"frontend"));
    $relatedOrder = $session->getData("orderid");