assigning class object as a session variable HELP!
Posted: Tue Apr 06, 2004 5:25 pm
I'm trying to pass along a class object as a session variable, and I'm not having much luck.
basically I have
then in a seperate script
Basically, my code is acting like $obj is a class without any values assigned within it. Its like its brand spankin new. What am I doin wrong here?
basically I have
Code: Select all
include ('cClass.class.php');
session_start();
if (!empty($_SESSIONї'obj']){
unset($_SESSIONї'obj']);
}
$obj = new cClass('construct it');
$_SESSIONї'obj'] = $obj;Code: Select all
include ('cClass.class.php');
$obj = new cClass(); //added this line because i was getting an error about instantizing a class object before its been defined or something
session_start();
$obj = $_SESSIONї'obj'];
echo $obj->get_something();