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

Frontend Autologin
 
BBrizzio
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2008-05-19
salò, Brescia, Italy
 

I have to implement a single sign on system to let users enter in a magento account.
The SSO part is not a problem.
To complete the code a need to force the magento login.
I’ve partially soplved the problem:

require_once('app/Mage.php');
$login='test@test.com';
$password='test';
$session Mage::getSingleton('customer/session');
$session->login($login,$password);

The previous code (simplified) works only if I launch Mage::run();
I other words it works only if I put it in the “index.php”.

The same code doesn’t work if I put it in a “login.php” script and then I redirect the browser to index.php.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bcelenza
Member
 
Avatar
Total Posts:  44
Joined:  2008-08-27
 

Try adding

Mage::app('default');
after the require. Not sure if I’m understanding the problem, but hope that helps a little.
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top