开发者

Logout problem in html frame and codeIgniter

开发者 https://www.devze.com 2023-01-29 22:42 出处:网络
I m using PHP and framework is codeigniter. I have put iframe to display all data. when I click logout link, I cleared session value and redirect to login page.

I m using PHP and framework is codeigniter. I have put iframe to display all data. when I click logout link, I cleared session value and redirect to login page. but when again if I press back button it shows me the previous frame contain. and some time It display nothing on frame after 开发者_运维问答press back button of browser, but if I press refresh button then it will reinitialize session and work again. so pleas tell me ho to destroy session in codeIgniter so if user press back button he can not visit it.


It is rather to browser cache than undestroyed session, so you have to send some headers to prevent caching the page while user is logged in:

header('Expires: '.date('r',time()-86400) ); // Date from the past
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header('Pragma: no-cache');

[+] And if you are using cookies as sessions identifiers in iframe, be aware that Internet Explorer neds additional header

header('P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');

to set cookie from inside iframe.

0

精彩评论

暂无评论...
验证码 换一张
取 消