I have a problem with my login script: I have this 3 scripts
index.php
ob_start();
session_start();
include ('config.php');
include ('home.php');
ob_end_flush();
home.php
if($_SESSION['logged_in']) {
echo $_SESSION['nome'];
} else { ?>
<form name="login" action="checklogin.php";>
...
<?php } ?>
checklogin.php
ob_start();
session_start();
include("config.php");
if(isset($_POST['Submit'])) {
...
$_SESSION['logged_in'] = TRUE;
header("Location: http://$root");
die();
}
ob_end_flush();
My problem is this: When I try to log for the first time my page refresh without show the session. Why?? If a try to close and re-open my browser or log for the second time it will show the session. Why? What should I do?