Re: Getting Objects out of the $SESSION variable unscathed
| From: | Stuart Dallas | Date: | Thu, 12 Feb 2015 20:41:01 +0000 |
| Subject: | Re: Getting Objects out of the $SESSION variable unscathed | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-324444@lists.php.net to get a copy of this message | ||
On 12 Feb 2015 20:00, "JEofVA" <JEofVA@gmail.com> wrote:
>
> I'm having a problem getting my objects out of the $SESSION variable. I
am storing an ordinal array of associate arrays where one of the associate
array elements is an object. Unfortunately, when I pull it back out, the
object is "broken" with "__PHP_Incomplete_Class" errors.
>
> From what I can read this has something to do with 'serialization' -
i.e., the emerging object must be unserialized (
http://php.net/manual/en/function.unserialize.php).
However, I can't get it
to work.
>
> Any tips on how that is done, or what I should do instead?
For those objects to be unserialised the class must already have been
included, otherwise PHP can't reconstruct it correctly. The error indicates
that the class does not exist.
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/