note 20832 deleted from language.oop.serialization by danbrown

From: Date: Sat, 07 Nov 2009 19:13:13 +0000
Subject: note 20832 deleted from language.oop.serialization by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-162614@lists.php.net to get a copy of this message
Note Submitter: hhuggins at fedex dot com ---- The problem with objects during session management arise because the object definition must exist before starting the session. i.e. if you have object x and you want to use it in a session, you have to perform the following. <? class x { ...definition here } // php now knows what x is... start the session session_start(); session_register("x_as_variable"); ?> if object x is defined in another file, make sure that the file is included or required BEFORE you start the session. <? require("x.inc"); session_start(); session_register("x_as_variable"); ?> This stops the INCOMPLETE_OBJECT response eliminating the need to create an array representation for an object.

« previous php.notes (#162614) next »