www サーバーへのログインに問題があります。ワンプ(ローカル)では、すべてうまくいきます。サーバーにサイトをアップロードしたとき、ログインが機能せず、リダイレクトも表示されます。ログインフォームがあります。ログインをクリックすると、ユーザーコントローラーに移動してログインアクションが行われます。ログイン アクションは次のようになります。
public function login(){
if($this->request->is('post')){
if($this->Auth->login()){
$this->redirect($this->referer());
}
else{
$this->Session->setFlash(__('Wrong username or password'));
$this->redirect($this->referer());
}
}
}
成功した場合とそうでない場合の両方をリダイレクトする必要があります。ユーザー/ログインページにとどまります。何が間違っている可能性がありますか?
AppController:
public $components = array(
'Session',
'Auth'=>array(
'logoutRedirect'=>array('controller'=>'main', 'action'=>'index')
)
);
public function beforeFilter(){
$this->Auth->allow();
}
形:
<?php
echo $this->Form->create('User', array('action' => 'login'));
echo $this->Form->input('username', array('label'=>__('Username:')));
echo $this->Form->input('password', array('label'=>__('Password:')));
echo $this->Form->end(__('Login'));
?>