Skip to content

Instantly share code, notes, and snippets.

@brodkin
Last active May 3, 2017 15:48
Show Gist options
  • Save brodkin/5891705 to your computer and use it in GitHub Desktop.
Save brodkin/5891705 to your computer and use it in GitHub Desktop.
Magento Force Customer Login Without Password
// Retrieve Customer by Email (or other method)
$customer = Mage::getModel('customer/customer')
->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
->loadByEmail($email);
// Set as Logged In and Clear Session
Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer)
->renewSession();
// Redirect or do something here :)
@jbatalla
Copy link

jbatalla commented Sep 1, 2014

Hi brodkin,

Where do i put this code in case i want customer to login without pass?

Thanks,
Jason

@kishankanani
Copy link

Hi brodkin,

Where do i put this code in case i want customer to login without pass?

Thanks,
Kishan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment