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

How to check from outside magento if customer is logged in
 
mandalousia85
Jr. Member
 
Total Posts:  4
Joined:  2009-01-19
 

I have successfully login my custumer from out side magento but i can’t to check if customer is logged, $session->isLoggedIn() turned false.
anyone can help me?
what the wrong in my code below.

require_once “catalogue/app/Mage.php”;
umask(0);
Mage::app();
Mage::getSingleton(’core/session’, array(’name’=>’frontend’));
$session = Mage::getSingleton(”customer/session”);
$session->start();
if ($session->isLoggedIn()) {
$customer = Mage::getSingleton(”customer/customer”)->load($session->getCustomerId());
echo $customer->getName().” Déconnexion“;
} else {
$layout = Mage::getSingleton(’core/layout’);
$block = $layout->createBlock(’customer/form_login’);
$block->setTemplate(’customer/form/mini.login.phtml’);
echo $block->toHtml();
}

 
Magento Community Magento Community
Magento Community
Magento Community
 
miquil
Jr. Member
 
Total Posts:  6
Joined:  2009-05-05
 

Hi, mandalousia85 did you find a solution to the problem??? I’m searching for the same thing…

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