请回答我的问题。我没有得到满意的答复。
问题是:“如何在cakephp注销后阻止访问访问过的页面?” 在此先感谢
答案 0 :(得分:0)
在AppController beforeFilter :
中// Check if the user is logged in
if (isset($this->Auth->user())) {
// Save the visited page in session
$this->Session->write('VisitedPages.', $this->here());
// If the user is not logged in
} else {
// If the user has logged out and visited the page before
if (isset($this->Session->read('VisitedPages.'.$this->here()))) {
$this->redirect('/errorPage');
}
}