I tried finding this on the boards, and its hard to believe that I'm the only person who's run into this problem. Alas.
Also, I know that sessions are serverwide, which is one reason why I'm so baffled as to why the session variables don't get passed. Here's my code:
class user
{
var $sessionData;
function user()
{
$this->sessionData = array( 'id' => "Index42",
'user' => "",
'name' => "",
'action' => "",
'level' => "",
'sesid' => "");
session_start();
session_register('sessionData');
}
function authenticate()
{
if(isset($this->sessionData["name"]))
return true;
else
return false;
}
}
When I call authenticate() it can't see the session variable (This is assuming I just clicked a link to log me in, which works fine, it authenticates me (not using this authenticate function) and assigns values to the sessionData array). Any idea what's going on? Is there something special about sessions and OOP?