Is it possible to store an object in the session? something like this...
My auth class:
<?php
class authenticate{
var $username;
var $password;
var $auth_level;
var $authenticated=false;
var $login_date;
var $id;
}
?>
The page where I store this in the session:
<?php
include "authenticate.php";
session_start();
$auth = new authenticate();
$auth->username="Greg";
$auth->password="1234";
$auth->login_date="Today's Date";
$auth->auth_level=1;
$auth->id=1;
session_register("auth"
;
?>
This way I can store all the users attributes in an object, and then store that object in the session, and access them when I need them. This works very well when done with java, but I havent gotten it to work in php.. and from what I've read, I need to store each one these in the session individually. Does anyone know a way around this?
Thanks,
Greg
My auth class:
<?php
class authenticate{
var $username;
var $password;
var $auth_level;
var $authenticated=false;
var $login_date;
var $id;
}
?>
The page where I store this in the session:
<?php
include "authenticate.php";
session_start();
$auth = new authenticate();
$auth->username="Greg";
$auth->password="1234";
$auth->login_date="Today's Date";
$auth->auth_level=1;
$auth->id=1;
session_register("auth"

?>
This way I can store all the users attributes in an object, and then store that object in the session, and access them when I need them. This works very well when done with java, but I havent gotten it to work in php.. and from what I've read, I need to store each one these in the session individually. Does anyone know a way around this?
Thanks,
Greg