I have created a magento extension. I want to implement access to the extension. The extension creates a page in frontend and i want only admin to access that page. So basically
Check this blog, I think you need not check with start()
before checking with isLoggedIn()
.
Mage::getSingleton('core/session', array('name'=>'adminhtml')); // get sessions
$check = Mage::getSingleton('admin/session', array('name'=>'adminhtml')); //get admin sessions
if($check->isLoggedIn()) { //check is admin logged in
echo "Admin is logged in";
} else {
echo "Admin is offline";
}