Re: [PHP] Stopping objects from auto-serializing



David Christopher Zentgraf wrote:
On 31 Oct 2007, at 15:32, Jochem Maas wrote:

aside from this error (my guess is your not allowed to override it) I
can't
see the problem of serialization .. don't put the object in $_SESSION?
...
what are you doing? show us the code?

I'm not putting the object in $_SESSION, but PHP apparently does on this
specific configuration.
I'm saving an array of ids in $_SESSION["basket"], and on some pages I
have an object called $basket.
Somehow this $basket gets saved into $_SESSION["basket"], where it
simply does not belong because it makes my code barf.

Seems I'll have to rename my variables, but aside from this specific
fix, I don't want any unneeded variables floating around my $_SESSION
and I certainly don't want them to be globally_registered.

are you using session_register()? (dont)
also are you setting the value in $_SESSION by reference?

e.g. $_SESSION['foo'] =& $bar; $bar = new Foo;


.



Relevant Pages

  • Re: [PHP] Stopping objects from auto-serializing
    ... this specific configuration. ... Somehow this $basket gets saved into $_SESSION, where it simply does not belong because it makes my code barf. ... Seems I'll have to rename my variables, but aside from this specific fix, I don't want any unneeded variables floating around my $_SESSION and I certainly don't want them to be globally_registered. ...
    (php.general)
  • RE: Session management on web farm with sql server
    ... For binary serialization and implement your custom serialization approach, ... objects in session. ... serialization/deserialization in sql server, the reference to the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: JSP Sessions,Attributes, and Deep Copy
    ... Java's standard serialization mechanism follows ... Second, session attributes. ... track a reference to the object in such a way that it can later ... set non-serializable objects as session attributes if you want your ...
    (comp.lang.java.programmer)
  • Re: State Management
    ... serialization. ... or Out-Of-Process session state as these session storage methods ... temporarily store state. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Session management on web farm with sql server
    ... For serialization, since winform/desktop application can hold most objects ... based) and may work between client and server machines, ... the approach i use for complex objects I store in session, ... serialization/deserialization in sql server, the reference to the ...
    (microsoft.public.dotnet.framework.aspnet)