I am doing mobile apps and I would like to know how to check whether user is already logged in or not. Is there any observer event to track? If it is detected that the account is logged in, the user will be directed to Account Information page. If not, the user will be directed to login or registration page.
<?php
if(!Mage::getSingleton('customer/session')->isLoggedIn()){
//not logged in
}else{
// logged in
}
?>
You can check if user is logged in in the application with this piece of code:
Mage::getSingleton('customer/session')->isLoggedIn()
After you can get information about user. For example:
$customer_data=Mage::getSingleton('customer/session')->getCustomer();
echo "<pre>" print_r($customer_data);