CodeIgniter Forums
Stop Backdoor - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Stop Backdoor (/showthread.php?tid=50151)



Stop Backdoor - El Forum - 03-15-2012

[eluser]Unknown[/eluser]
After successful login I am storing a variable in session then on homepage I am checking it , whether it exists or not?, and I am also destroying the session on log out
but when I log out then I am going to log out page but when I am clicking back button I am coming back to the home page (previous page)
and when I refreshing the page I am again getting sign out.
How to solve this error and how to destroy session on Log Out Only.

Gary


Stop Backdoor - El Forum - 03-15-2012

[eluser]skunkbad[/eluser]
You need to send no-cache headers on any page has content that is based on login.


Stop Backdoor - El Forum - 03-16-2012

[eluser]Unknown[/eluser]
How to set no-cache header on any page, please reply, can you give me the complete code for login, home and logout.


Stop Backdoor - El Forum - 03-16-2012

[eluser]InsiteFX[/eluser]
Place this at the top of the page that you do not want to cache:
Code:
<?php
// Set no caching
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>