Re: PHP 5.0. Save classes in a session. Need help now

From: Date: Thu, 12 May 2005 01:59:46 +0000
Subject: Re: PHP 5.0. Save classes in a session. Need help now
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-215002@lists.php.net to get a copy of this message
On Wed, May 11, 2005 5:19 pm, Oscar Andersson said: > Is it possibele to save a class in a session > > ex. > > $cl = new Class(); > $SESSION['this_class'] = cl; Yes, but... You'd have to actually use $cl in that last line, and you need to require the file that defines the class definition *BEFORE* you start your session in the next page where you expect the class instance to exist. Actually, you could maybe get away with starting the session, the loading the class definition, then accessing the $cl variable... But I'm not sure of that, because I don't use classes, and even if I did, I'd load in all the class files before I started my session, just on principle. -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#215002) next »