Jump to content

Serialized Session not clearing/unsetting


Go to solution Solved by CroNiX,

Recommended Posts

I'm teaching myself a bit of OOP in php.  found that i could pass an object into the SESSION array if i serialize() the object and then unserialize() it where i need it in other page files.  all seems to work well until it comes time for a user to logout from my application and attempt to destroy the session.  at times, when they log back in, this serialized SESSION value seems to still be set while other SESSION values have been cleared.  at least i *thinnk* this is what is going on.

 

in my logout handler, i have the following:

    $_SESSION = array(); // clear all SESSION vars
    setcookie(); // clear cookies
    session_destroy();

but the above does not seem to be working.  my guess is there is something native to serialized SESSION values that im not yet aware of.  any help here would be much appreciated.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.