I am working on simple php script with email functionality which is depends on admin login in magento admin panel. I use this code for check session of admin in my php file.

if (Mage::getSingleton('admin/session')->isLoggedIn())

But it not provides any thing. Are we able to access magento session outside magento setup or not.I am using php file here.Let me know what i do i need to get session of magento admin outside of magento.

1 Answer 1


Try this stuff

//get the admin session
Mage::getSingleton('core/session', array('name'=>'adminhtml'));

//verify if the user is logged in to the backend
  //do stuff
  echo "go away bad boy";

Else try var_dumping the $session variable? Maybe it will help you get on the right track...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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