[英]Symfony 2.6 logout back button (CakePHP)
在嘗試了許多不同的方式(成功的處理程序,緩存指令,更改路由,覆蓋方法等)之后,我無法注銷用戶(使用FOSUserBundle),從而使她無法在按下后退按鈕時看到前一頁瀏覽器。
Symfony 2.6中有辦法嗎?
在CakePHP中,這在控制器中完美工作
public function logout() {
session_destroy();
$this->Auth->deny('*');
$this->Auth->shutdown('*');
$this->Session->setFlash('Logout succesful - no back button issue.');
return $this->redirect($this->Auth->logout());
}
將以下標頭添加到應用程序頁面的頂部:
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Pragma: no-cache");
header("Expires: 0");
您可以重定向到注銷頁面:
return $this->redirectToRoute('fos_user_security_logout');
您需要向瀏覽器發送no-cache指令嘗試此解決方案https://stackoverflow.com/a/41566590/1154919
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.