Skip to main content
format the error
Source Link
Manashvi Birla
  • 8.9k
  • 9
  • 28
  • 53

I am working on custom login using below code, before it was working fine now its giving error.

Error: An uncaught Exception was encountered Type: Mage_Core_Model_Session_Exception Message: (null)

An uncaught Exception was encountered Type: Mage_Core_Model_Session_Exception Message: (null)

I don't know what caused this error. Please help me to fix this error

Thank you

<?php
function loginUser( $email, $password )
require_once ("app/Mage.php");
umask(0);
ob_start();
session_start();
Mage::app('default');
Mage::getSingleton("core/session", array("name" => "frontend"));

$websiteId = Mage::app()->getWebsite()->getId();
$store = Mage::app()->getStore();
$customer = Mage::getModel("customer/customer");
$customer->website_id = $websiteId;
$customer->setStore($store);
try {
    $customer->loadByEmail($email);
    $session = Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer);
    $session->login($email, $password);
}catch(Exception $e){

} 


} 
?>

} ?>

I am working on custom login using below code, before it was working fine now its giving error.

Error: An uncaught Exception was encountered Type: Mage_Core_Model_Session_Exception Message: (null)

I don't know what caused this error. Please help me to fix this error

Thank you

<?php
function loginUser( $email, $password )
require_once ("app/Mage.php");
umask(0);
ob_start();
session_start();
Mage::app('default');
Mage::getSingleton("core/session", array("name" => "frontend"));

$websiteId = Mage::app()->getWebsite()->getId();
$store = Mage::app()->getStore();
$customer = Mage::getModel("customer/customer");
$customer->website_id = $websiteId;
$customer->setStore($store);
try {
    $customer->loadByEmail($email);
    $session = Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer);
    $session->login($email, $password);
}catch(Exception $e){

}

} ?>

I am working on custom login using below code, before it was working fine now its giving error.

Error:

An uncaught Exception was encountered Type: Mage_Core_Model_Session_Exception Message: (null)

I don't know what caused this error. Please help me to fix this error

Thank you

<?php
function loginUser( $email, $password )
require_once ("app/Mage.php");
umask(0);
ob_start();
session_start();
Mage::app('default');
Mage::getSingleton("core/session", array("name" => "frontend"));

$websiteId = Mage::app()->getWebsite()->getId();
$store = Mage::app()->getStore();
$customer = Mage::getModel("customer/customer");
$customer->website_id = $websiteId;
$customer->setStore($store);
try {
    $customer->loadByEmail($email);
    $session = Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer);
    $session->login($email, $password);
}catch(Exception $e){

} 


} 
?>
Source Link

Mage_Core_Model_Session_Exception in login code magento 1.9

I am working on custom login using below code, before it was working fine now its giving error.

Error: An uncaught Exception was encountered Type: Mage_Core_Model_Session_Exception Message: (null)

I don't know what caused this error. Please help me to fix this error

Thank you

<?php
function loginUser( $email, $password )
require_once ("app/Mage.php");
umask(0);
ob_start();
session_start();
Mage::app('default');
Mage::getSingleton("core/session", array("name" => "frontend"));

$websiteId = Mage::app()->getWebsite()->getId();
$store = Mage::app()->getStore();
$customer = Mage::getModel("customer/customer");
$customer->website_id = $websiteId;
$customer->setStore($store);
try {
    $customer->loadByEmail($email);
    $session = Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer);
    $session->login($email, $password);
}catch(Exception $e){

}

} ?>