<?php
require_oncedirname(__FILE__).
'
/app/Mage.php';
umask(0) ;
$_SESSION['wz']['customer_id'] = null;
Mage::app();
// Checking for customer session
Mage::getSingleton('core/session', array('name'=>'frontend') );
$session=Mage::getSingleton('customer/session', array('name'=>'frontend') );
$customer_data = Mage::getModel('customer/customer');
if ($session->isLoggedIn()) {
//echo "Customer is logged in";
$_SESSION['wz']['customer_id'] = $session->getId();
} else {
//echo "Customer is NOT logged in ";
unset($_SESSION['wz']);
header("Location: error.php?mode=unk_user");
}
Friday, November 9, 2012
How to access Magento user's session from outside Magento?
Labels:
Magento
Subscribe to:
Post Comments (Atom)
1 comment:
Thanks for the best blog.it was very useful for me.keep sharing such ideas in the future as well.this was actually what i was looking for,and i am glad to came here!
magento development company in bangalore
Post a Comment