Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 用于客户登录会话的Magento API_Php_Magento_Session - Fatal编程技术网

Php 用于客户登录会话的Magento API

Php 用于客户登录会话的Magento API,php,magento,session,Php,Magento,Session,我在Google&StackOverflow上搜索了很多,但仍然没有从另一台服务器获得客户登录创建会话的代码或建议 我使用了此代码,但它不起作用: $session = Mage::getSingleton( 'customer/session' ); Mage::app()->getStore()->setWebsiteId(1); try { $session->login( $email, $password ); $customer = $sessio

我在Google&StackOverflow上搜索了很多,但仍然没有从另一台服务器获得客户登录创建会话的代码或建议

我使用了此代码,但它不起作用:

$session = Mage::getSingleton( 'customer/session' );
Mage::app()->getStore()->setWebsiteId(1);

try {
    $session->login( $email, $password );
    $customer = $session->getCustomer();

    return json_encode(array('status' => 'OK', 'userData' => $this->info($customer->getId())));
}
catch( Exception $e ) {
    return json_encode(array('status' => 'error', 'message' => $e->getMessage()));
}

哪一位不工作?嗨,我使用上面的代码从另一台服务器为magento站点创建会话,但它不工作是的,但哪一位不工作?它得到会话单例吗?它是否从捕获返回错误?我们不能用“它不工作”来做太多的事情。它这样响应,但没有创建会话。它给了我以下结果&没有为客户在浏览器上创建会话