session_register in a class

From: Date: Thu, 10 Aug 2000 21:17:54 +0000
Subject: session_register in a class
Groups: php.general 
Request: Send a blank email to php-general+get-11225@lists.php.net to get a copy of this message
I was looking at the documentation for the session_register() function. Am I correct here: You would type in session_register('foo'); and puts the value of $foo in your session, and it available as $foo in other php files in the same session. I want to register session variables in a method of a class. This is a brief example of the class i'm using: class myClass { var $prop1 = "foo"; var $prop2 = "bar"; function createSession() { session_start(); session_register('prop1'); session_register('prop2'); /* i want the above to have the values of $this->prop1 and $this->prop2 */ } } Any ideas on this? Cheers, The Captain

« previous php.general (#11225) next »