This is my first time using session variables and I thought they are accessible throughout the site if they are set. I set my $_SESSION['user'] on my login page and but cannot read it once it gets to the next main page. The program is not throwing any errors.
Login_chk.php
The above echo statement prints the correct information. On the employee page there is nothing.
What is wrong here?
Login_chk.php
Code:
$_SESSION['user']=$xmgr->fname . " " . $xmgr->lname; // Initializing Session
echo $_SESSION['user'];
if ($xmgr->position == "Manager") {header("location: manager.php");}
else {header("location: employee.php");}
The above echo statement prints the correct information. On the employee page there is nothing.
Code:
echo "<b>Hello:</b>" . $_SESSION['user'];
What is wrong here?