I have a login which registers a session. Here is a code snippet.
///code///
if($count==1){
// Register $username, $password and redirect to file "index.php"
session_register("username");
session_register("password");
header("location:index.php");
}
///code///
In all of my other files I have
///code///
session_start();
if(!session_is_registered('username')){
header("location:main_login.php");
}
///code//
All of this works correctly. It sets a seesion and opens the pageif I authenticated. The problem is I can't grab the session variable in another script. Can you tell me why this would not work.
///code///
///code///
It gives me this error.
Notice: Undefined index: username in /var/www/html/track/v04/test.php on line 3
Anyone know why this would not work? $_SESSION is supposed to be global.