Re: store class zithin session

From: Date: Fri, 21 Nov 2008 15:04:27 +0000
Subject: Re: store class zithin session
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-283633@lists.php.net to get a copy of this message
Hi Stut, On Thu, Nov 20, 2008 at 12:25 PM, Stut <stuttle@gmail.com> wrote: > On 20 Nov 2008, at 11:01, Alain Roger wrote: > >> i have a class and i would like to store it zithin session. >> i was thinking to use serialize/unserialize but it does not work. >> >> any idea how to do it ? >> > > Alain, you've been on this list long enough to know that "it does not work" > is not enough information for people to be able to help you. > You're right and i feel sorry. i thought i paste my code just after the sentence. ok, anyway i solved my problem somehow :-) > > Firstly there is no need to serialise anything going into the session. > Secondly I assume you want to store objects not classes. yes. > Thirdly there is no reason why it should not work, but there are some > caveats you need to be aware of... > > * The class definition must have been loaded before session_start() is > called, otherwise you'll end up with an object of type stdClass rather than > your class. this was my mistake...i mean to not call the class file before starting the session :-( A.

« previous php.general (#283633) next »