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:
Then if $loggedIn == true, the login form is replaced by something else... Hence keeping it all on one page, index.php (excluding login.php).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"; ?>
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();
But the output is: Array()Code:print_r($_SESSION);
Which is blank.
Why is the $_SESSION variables clearing itself upon entering the page (index.php)?




Reply With Quote