$sess_userid = $this->Auth->user('id'); if (empty($sess_id)) { // session flash message $this->redirect(array('controller'=>'users' ETC)); }