Hi
I have just today started to look into PHP sessions and have created my LOGIN page. But when I LOGOUT and close the browser. I can still open a new browser window and bypass the LOGIN page and access other parts of my application.
When I login I set the following variable:
In my logout I am doing this:
And the top of the page I access afterwards - to see if it will kick me out - I have this - And this is where I think it must be wrong - but I cannot see it! It bypasses this code and runs the page! Any help greatly appreciated!
I have just today started to look into PHP sessions and have created my LOGIN page. But when I LOGOUT and close the browser. I can still open a new browser window and bypass the LOGIN page and access other parts of my application.
When I login I set the following variable:
Code:
$_SESSION['Logged_In'] = "True";
In my logout I am doing this:
Code:
<?
session_start();
header("Cache-control: private"); //IE 6 Fix
session_unregister('Logged_In');
$_SESSION['Logged_In'] = False;
$_SESSION['s_password'] = False;
$_SESSION = array();
session_destroy();
// Redirect to show results..
echo "<script>document.location.href='index.php'</script>";
?>
And the top of the page I access afterwards - to see if it will kick me out - I have this - And this is where I think it must be wrong - but I cannot see it! It bypasses this code and runs the page! Any help greatly appreciated!
Code:
<?php
session_start();
if ($_SESSION['Logged_In'] = FALSE)
{
echo "<script>document.location.href='index.php'</script>";
}