How to check admin is logged in or not on frontend

Hello Friends, Here is the code to check on frontend (i.e. in any frontend file) whether the admin is logged in or not in Admin Panel.
<?php
	require_once('app/Mage.php');
	Mage::app('default');
	Mage::getSingleton('core/session', array('name' => 'adminhtml'));
	$session = Mage::getSingleton('admin/session');
	if ( $session->isLoggedIn() ) {
	echo "logged in";
	} else {
	echo "not logged in";
	}
?>
Thanks,
Pritesh Pritesh

Pritesh Pethani

Request a Quote!!

Share your concept and we will return to you within 24 hours. Let us work out the best software solution for you!

Let's Start
Whatspp