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
could sessions get corrupted?
Moderator: General Moderators
- iankent
- Forum Contributor
- Posts: 333
- Joined: Mon Nov 16, 2009 4:23 pm
- Location: Wales, United Kingdom
Re: could sessions get corrupted?
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
code would help
Re: could sessions get corrupted?
i just put a small class in the session so i can do database lookup
- iankent
- Forum Contributor
- Posts: 333
- Joined: Mon Nov 16, 2009 4:23 pm
- Location: Wales, United Kingdom
Re: could sessions get corrupted?
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?
better to see your class. something wrong there!
Re: could sessions get corrupted?
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?
That's never happened in PHP!