Cakephp をご存知の場合は、この Cakephp コードをご覧ください。なぜ AuthComponent::user('id') が値を取得できないのでしょうか?
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->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"); } }