note 20832 added to language.oop.serialization
| From: | hhuggins at fedex dot com | Date: | Wed, 17 Apr 2002 17:52:28 +0000 |
| Subject: | note 20832 added to language.oop.serialization | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-29497@lists.php.net to get a copy of this message | ||
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.
--
http://www.php.net/manual/en/language.oop.serialization.php
http://master.php.net/manage/user-notes.php?action=edit+20832
http://master.php.net/manage/user-notes.php?action=delete+20832
http://master.php.net/manage/user-notes.php?action=reject+20832