View Full Version : Resolved Session before header.

01-17-2010, 12:40 AM
Ok, So I am trying to make a script that makes sure users are logged in when viewing the page, and if not, send them to the home page, and send a session variable with a code for a message that tells them they must be logged in. However this is not working

$_SESSION['mcode'] = 3;
header('Location: game.php?side=news');

If I take out the header then the code works, however on the other page, when I try to out put all session variables to check for it. It shows it is 0, not three as it should be. Can anyone help me out here?

I found the issue, thank you all who read.