0
我是cakephp中的新成員。我使用2.5版本。我在註銷功能方面有問題。代碼
$this->Session->destroy();
如果我在退出會話後點擊後退按鈕,那麼歡迎頁面出現,在我的代碼中不工作。刷新歡迎頁面後,會話將破壞..這是我的問題會話。
public function logout(){
$this->Session->delete('username');
if($this->Session->destroy()) {
echo $this->Session->setFlash("Congrats, you have successfully logged Out");
$this->redirect('/users/login');
}else{
echo $this->Session->setFlash("you failed in log Out");
}
}