BuildMyWeb Posted December 11, 2014 Share Posted December 11, 2014 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. Quote Link to comment Share on other sites More sharing options...
Solution CroNiX Posted December 11, 2014 Solution Share Posted December 11, 2014 Check the manual for session_destroy(), just calling setcookie() doesn't do anything as you didn't supply any data. They have examples on how to properly do that to a session cookie. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.