Re: Sessions and Objects

From: Date: Sat, 17 Jun 2000 15:25:17 +0000
Subject: Re: Sessions and Objects
References: 1  Groups: php.dev php.general 
Request: Send a blank email to php-dev+get-21611@lists.php.net to get a copy of this message
On Fri, 16 Jun 2000, James Du Russel wrote: > When PHP 4 restores objects from a session, if the class is not defined, > the object type reverts to 'stdClass' As long as session_start() > happens belows class definitions, the code works fine. > > Here's the problem. Page A creates an object of some type, and stores > it into the session. The user works with page A for a while, then moves > over to page B. Page B has no requirement for the object created by > page A, but the session data is required (for the logged in user object) Have page B include a file with class declaration before loading session. Even though it has no requirement for that object, it won't hurt it to include the declaration so that the object may be properly instantiated. -Andrei * We are not a clone. *

« previous php.dev (#21611) next »