Re: complex objects and sessions

From: Date: Sat, 14 Jul 2001 17:49:15 +0000
Subject: Re: complex objects and sessions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-57892@lists.php.net to get a copy of this message
Hi David! On Sat, 14 Jul 2001, David Brumley wrote: > Hi, > Was the complex object issue ever fixed in PHP 4? works just fine for me (since 4.0.4pl1) > > I'm running 4.0.6 with imap, and have built a class IMAPSession > defined in lib/sessionobject.inc.php. Here is a script: > <?php > > $config = array(); > > require("config/defaults.inc.php"); > require("lib/common.inc.php"); > require("lib/sessionobject.inc.php"); > require("lib/imap_read.inc.php"); > > > session_start(); > session_register(csession); > include("Template/header.html"); > if(! $csession ){ > $csession = new IMAPSession($state); in which file is IMAPSession defined? > } > if(! $state){ > $state = "start"; > } > $csession->SwitchContext($state, $msg); > ?> > > My understanding is that the "csession" object should be stored. But > on the second invocation I get: > > Fatal error: The script tried to execute a method or access a property > of an incomplete object. Please ensure that the class definition > imapsession of the > object you are trying to operate on was loaded _before_ the session > was started in /d0/www/htdocs/webmail/index.php on line 20 > > > any hints would be appreciated. be sure you have the class definition available before calling session_start(); -- teodor

« previous php.general (#57892) next »