懂cakephp的帮忙看一下这段cakephp的代码,为什么AuthComponent::user('id')取不到值
function login(){ if(empty($this->request->data['User']['username']) or empty($this->request->data['User']['password'])){ $this->Session->setFlash('Please intyped a valied account!'); }elseif ($this->Auth->login($this->request->data['User'])) { $this->User->id= AuthComponent::user('id'); $this->redirect("/users/index"); } else{ $this->redirect("/users/logout"); } }