
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 0.58 KB | hits: 45 | expires: Never
Magento external login will not create session cookie
//Get Magento session-object
Mage::getSingleton("core/session", array("name"=>"frontend"));
$session = Mage::getSingleton("customer/session", array("name"=>"frontend"));
//Check if logged in
if(!$session->isLoggedIn()){
//Not logged in, therefor log in
$mpassword = $this->getMagentoPassword();
$musername = $this->getAddress();
try
{
$session->login($musername, $mpassword);
}catch(Exception $e){
echo $e->getMessage();
}
}