note 16536 added to ref.session
| From: | dkodeNOSPAM at full-fx dot com | Date: | Sat, 03 Nov 2001 06:14:30 +0000 |
| Subject: | note 16536 added to ref.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-20350@lists.php.net to get a copy of this message | ||
I just spent 6 hours ripping my hair out over passing objects through sessions. As mentioned above
you need to include your class BEFORE you register the object.
i.e.
<?
session_start();
include("inc/your_class_file.php");
session_register("object_var");
?>
other than that, you do not need to serialize and unserialize the object, PHP does that
automatically for you.
Hope this helps anyone else who might run into the same headache I did.
--
http://www.php.net/manual/en/ref.session.php
http://master.php.net/manage/user-notes.php?action=edit+16536
http://master.php.net/manage/user-notes.php?action=delete+16536
http://master.php.net/manage/user-notes.php?action=reject+16536