Search code examples
phpmagentomagento-soap-api

Magento soap call customer auto login from php


I have created a magento soap login i need to do customer auto login after completed the registration process....

need to login outside of magento

Can any one please help me?...


Solution

  • define("MAGE_BASE_DIR","/home/seansinn/public_html");
    require_once MAGE_BASE_DIR."/app/Mage.php";
    Mage::app("default");
    
    Mage::getSingleton("core/session", array("name" => "frontend"));
    $session = Mage::getSingleton("customer/session");
    
    try {
        $login = $session->login($username,$password);
        if ($session->isLoggedIn()) {
            echo "Successfully Logged in";
        } else {
            echo "Not Logged in";
        }
    }