Cakephp check if user is logged or not

How to check if user is logged or not in the view or controller in cakephp.Very simple.Look at this function.It will return current logged user details.So you can check this by using user ID or use…