CodeIgniter Forums
Session redirect - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Session redirect (/showthread.php?tid=61021)



Session redirect - El Forum - 08-30-2014

[eluser]rainfall[/eluser]
Hi

I am working with simple session pages.
I used below code to prevent caching when user press the back button ..
Code:
<?php
header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");

?>

Now I want to redirect to my login page when user press back button in browser .

How to do it ??? i tried few things but not working ...


Session redirect - El Forum - 08-30-2014

[eluser]InsiteFX[/eluser]
Code:
<?php
header("Location: http://www.example.com/"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>