注销后的CodeIgniter后退按钮 [英] CodeIgniter back button after logout

查看:151
本文介绍了注销后的CodeIgniter后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户退出我的CodeIgniter(PHP)应用程序时,我试图停止/禁用浏览器的后退按钮功能。但是,我认为浏览器是缓存页面,所以它变得可见,尽管会话被销毁从注销。

I'm trying to stop/disable the back button functionality of the browser when a user logs out of my CodeIgniter (PHP) app. But, I think the browser is caching the page so it becomes visible despite the session being destroyed from logout.

我知道会话已经死了,因为当用户尝试做任何东西(点击任何链接等),他们通过我的控制器中的方法被踢出。

I know the session is dead because when the user tries to do anything (click any link etc) they are kicked out through the methods in my controller.

这是不理想的后退按钮工作在这种方式,因为上一页包含机密信息。

It's not ideal to have the back button working in this manner since the previous page contains confidential information.

不是如何解决这个问题的线索,也许一个重定向页之间(但用户可以后面的按钮真的很快吗?),帮助!

Not a clue how to tackle this one, maybe a redirect page in between (but then the user could slam the back button really quick right?), help!

感谢。

推荐答案

添加此项以防止缓存上一页:

Add this to prevent caching of the previous page:

header("cache-Control: no-store, no-cache, must-revalidate");
header("cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

这篇关于注销后的CodeIgniter后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆