I'm trying to use authorize users to post on a discussion board.
file1> login.php
if ($status == 1)
{
session_start();
session_register('SESSION_UNAME');
$SESSION_UNAME = $USERNAME;
// I put this in to check to see if all's ok
print session_encode();
print "your session id is:".session_id();
printf("You are now logged in as $SESSION_UNAME. Please <a href=\"http://lesclos.com/forum.php\">click here</a> to continue.");
}
This part seems to work okay and yields:
SESSION_UNAME|s:8:"BillCowher";
your session id is:8cb53a4da3732208c8afe0177a0c0e3c
You are now logged in as BillCowher. Please click here to continue.
Then in file2 - forum.php
session_start();
if (!$SESSION_UNAME) { do stuff...}
but it doesn't do stuff. Instead it goes to a please login form
session id is the same, but $SESSION_UNAME is gone!
I took this program from an online tutorial and changed a few things but couldn't get the original to work as it was anyways.
I'd appreciate any help.