1
頁面
在我的應用我有登錄和註銷行爲CakePHP的 - 登錄和註銷重定向後,不重裝
function login()
{
$this->layout = 'cake';
if ($this->request->is('post')) {
$this->Auth->login();
if ($this->Auth->login()) {
$this->redirect(array(
'controller' => 'photos',
'action' => 'flow'
));
}
else {
$this->Session->setFlash('Nome de usuário ou senha incorreto', 'default', array(
'class' => 'flash_fail'
));
}
}
}
但是,當用戶登錄,並轉到photos/flow
用戶名不出現。我需要刷新頁面(F5)以顯示用戶信息。 有一種重定向和刷新信息的方法? 謝謝。
爲什麼要使用'$ this-> Auth-> login();'兩次?這是一個明確的殺手:)第二個將永遠返回false。 – mark