Re: Accessing session variables from within a class

From: Date: Fri, 11 Aug 2000 15:34:48 +0000
Subject: Re: Accessing session variables from within a class
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-11342@lists.php.net to get a copy of this message
$session_var needs to be declared global or you can't see it, even if you register it from inside of the class. Chris Thomas Emil Hansen wrote:
Hi, I tried to build a session class in order to incapsulate the code in a nice and clean manner. Unfortunately I had problems accessing the session variables from within the class. However, I had no problems accessing the session id, i.e.: $this->id = Session_Id(); was ok session_register("session_var"); $this->var = $session_var; was not ok I know you cannot see the entire code, so I won't expect you to do any debugging for me. I just wondered if there was a general problem accesing session variables from within a class, or if I have misunderstood something. - Thomas __________________________________________________ Do You Yahoo!? Kick off your party with Yahoo! Invites. http://invites.yahoo.com/


« previous php.general (#11342) next »