How to check whether user logged in or not
Cakephp 3.x
if($this->request->Session()->read('Auth.User')) { //user is logged in } else { //user not logged in }
Cakephp 2.x
if($this->Session->read('Auth.User')) { //user is logged in } else { //user not logged in }