Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Poll
Did you find this post helpful? please reply
Yes 0
No 0
Suggestion (Post Reply) 0
Total Votes: 0
You must be a logged-in member to vote
Login in magento store as a customer from outside the magento store
 
Anshu Mishra
Sr. Member
 
Total Posts:  101
Joined:  2012-04-23
India
 

require_once (’../app/Mage.php’);
umask(0);
Mage::app();
$session = Mage::getSingleton(’customer/session’);
try{
$session->login($_POST[’username’],$_POST[’password’]);
$session->setCustomerAsLoggedIn($session->getCustomer());

//Load the customer modules
$customer = Mage::getModel(’customer/customer’)->setWebsiteId(Mage::app()->getStore()->getWebsiteId());

//load customer by email
$customer->loadByEmail($_POST[’username’]);
header(’Location: http://’.$_SERVER[SERVER_NAME].’/customer/account/?SID=’.$session->getSessionId());

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top