I am storing login information in a $_SESSION variable. When the user enters their login information on the page index.php the login.php script is executed. The first line of login.php is session_start(); as variables are stored in sessions to be used throughout the website. If username & password are correct the user is redirected back to index.php using header('Location: index.php'); There is a bit of PHP on the top of the page that handles the $_SESSION variables:

Code:
<?php
session_start();
$loggedIn = false;
$siteName = "";
if(isset($_SESSION['loggedOn']) && $_SESSION['loggedOn'] == true){
include("xmlDOMDocHandler.php");
$loggedIn = true;
$siteName = getSiteName($skip,$user);
} else {
$loggedIn = false;
}
$bgcolor = "#27B9AD";
?>
Then if $loggedIn == true, the login form is replaced by something else... Hence keeping it all on one page, index.php (excluding login.php).

The login form will not go away.. It work's perfectly on Firefox, Google Chrome, Safari & Opera but it is not working with IE8. I've tried adding in this line after session_start();

Code:
print_r($_SESSION);
But the output is: Array()

Which is blank.

Why is the $_SESSION variables clearing itself upon entering the page (index.php)?