I have used this code in observer function and event i am using is "controller_front_init_before". Problem is due to first line. Please help me to resolve this issue

$customer_session = Mage::getSingleton('customer/session');

            $customer = Mage::getModel("customer/customer")->load($customer_session->getId());
            $group_id = $customer->getGroupId();


            $core_session = Mage::getSingleton('core/session');
            $LoginTime = $core_session->getLoginTime();

                $current_datetime = new DateTime();
                $otp_create_time = new DateTime($LoginTime);
                $interval = $current_datetime->diff($otp_create_time);
                $elapsed = $interval->format('%i');





            $LoginTime = $core_session->setLoginTime(date('Y-m-d h:i:s'));


closed as off-topic by Marius Jul 30 '15 at 12:02

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced OR seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Marius
If this question can be reworded to fit the rules in the help center, please edit the question.


Please add config.xml file of your module

Problem should be there. Also, you can read this https://stackoverflow.com/questions/22608376/mage-registry-key-singleton-already-exists-error

Not the answer you're looking for? Browse other questions tagged or ask your own question.