Storing a object in the session??

From: Date: Tue, 14 May 2002 18:02:02 +0000
Subject: Storing a object in the session??
Groups: php.general 
Request: Send a blank email to php-general+get-97595@lists.php.net to get a copy of this message
All, I really need help on this one... I have a class called "Profile" and I want to store the properties of this class in the session after I give them values shown below: Step 1: // set properties of class $objProfile = new Profile('1', 'John', 'Doe') ; // store object in session $_SESSION["ProfileObj"] = $objProfile; This is what my session file looks like: !SESSION|ProfileObj|O:7:"profile":5:s:7:"staffId";s:1:"1";s:9:"firstName";s: 5:"John";s:8:"lastName";s:6:"Doe";} Step 2: Then I would like to access them from another page. // Try to print the session object print_r($_SESSION[ProfileObj]); Results: __PHP_Incomplete_Class Object ( [__PHP_Incomplete_Class_Name] => profile [staffId] => 1 [firstName] => John [lastName] => Doe ) Is there a way to store this in the session successfully and if so how can I do access it later? Thanks, -p

« previous php.general (#97595) next »