.

.

Customer Logout in Magento Programmatically




$session = Mage::getSingleton('customer/session'); used for customer Logged Out.
Check Below code
<?php
require_once 'app/Mage.php';
 Mage::app('default');
 Mage::getSingleton("core/session", array("name" => "frontend"));
 // get login customer data
 if(Mage::getSingleton('customer/session')->isLoggedIn()) {
     $customerData = Mage::getSingleton('customer/session')->getCustomer();
      //echo $customerData->getId();
 }


//For Logout Customer
 Mage::getSingleton('customer/session')->logout();

$data['responseCode']='1';
$data['msg']="Logged Out Successfully";

$data2=json_encode($data);
echo $data2;

?>

2 comments

This is a great post. I like this topic.This site has lots of advantage. It helps me in many ways.Thanks for posting this again.
magento development company in bangalore 


EmoticonEmoticon