Page 1 of 1

could sessions get corrupted?

Posted: Sun Nov 22, 2009 10:08 am
by yacahuma
Is there anyway sessions could get corrupted. The last 2 weeks I am getting this very, very weird problem. I enter my username + password, I login into the application. I now logout(sessions get destroy). I now create a new user, and now I get either one of 2 things
1. I get the session from another user
2. i get kick back to the login page.

I login in again, and everything is fine. I NEVER seen this before in all the years working with php. So far this is just in my development machine. It happens once every 20 o so times. But it bothers me like hell. I been through the code a 1000 times looking to see if there is anything strange. But I just do the normal, login in, check user credentials, save user info in session and continue.

Any ideas.

Thank you

Re: could sessions get corrupted?

Posted: Sun Nov 22, 2009 10:14 am
by iankent
are you doing anything to your session variables when creating a new user? unless you want to log the new user in as soon as its created, you shouldn't need to do anything with the login session variables at all.

code would help :)

Re: could sessions get corrupted?

Posted: Sun Nov 22, 2009 11:47 am
by yacahuma
i just put a small class in the session so i can do database lookup

Re: could sessions get corrupted?

Posted: Sun Nov 22, 2009 11:50 am
by iankent
Could you post some code? Its difficult to say why its not working without seeing what your code is doing.

Re: could sessions get corrupted?

Posted: Sun Nov 22, 2009 3:35 pm
by morris520
better to see your class. something wrong there!

Re: could sessions get corrupted?

Posted: Sun Nov 22, 2009 9:02 pm
by yacahuma
instead of saving the full object, i just created a new userSession class that only has the bare minimum. I wonder if somehow my class was not properly being serialized into the session?? The strange behavior is not there any more (for now)

Re: could sessions get corrupted?

Posted: Tue Nov 24, 2009 5:31 am
by morris520
That's never happened in PHP!