How To Check Admin User Logged In Or Not In Magento.?

Check Admin User Logged In Or Not In Magento Frontend:- 

To check whether a admin user in logged in the front pages or not, you can do this with the below code and syntax respectively.


Mage::getSingleton(‘core/session’, array(‘name’ => ‘adminhtml’)); is used to get the admin end logged in user session.


This is the script which on running will fetch the desired results accordingly

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

if ( $session->isLoggedIn() ) {
   echo "logged in From Admin";
} else {
   echo "not logged in From Admin";
}

For more queries read on various issues, fixes and problems associated with Magento now!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *