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.

        //not logged in
        // logged in

You can check if user is logged in in the application with this piece of code:


After you can get information about user. For example:

echo "<pre>" print_r($customer_data);

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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