I am currently running PHP 4.0.4pl1 as an Apache module. I am trying to set a session for login and user information purposes. I have one page (index.php) that basically uses includes to show all other sections, so index.php?page=request would include the "request" section, etc. On the index.php page, I have:
session_start();
session_register('access');
if(get_cfg_var('register_globals')) {
$HTTP_SESSION_VARS['access'] = &$access;
}
If no session exists, then they are "sent" to index.php?page=login (which is a login form). A user logs in, and their username is checked against a MySQL db. If the username and password match, then I execute the following:
$access = array(
'username' => $username,
'level' => '$level'
);
$GLOBALS['HTTP_SESSION_VARS']['access'] =& $access;
At that point, I've tested it and the session is set correctly, and I can echo out the session array elements. Upon going to any other subsequent pages however (index.php?page=something), the session disappears. I've been struggling with this for the better part of the day, have done numerous searches, read tutorials, etc, and am out of ideas. I would greatly appreciate any thoughts on what is wrong, and how to solve it. Thanks very much in advance.