• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Losing Database Sessions

I'm having a heck of a time with the most random bug in my app. I'm storing sessions in the database and checking to see if the user id exists in the session userdata. It works like a charm 90% of the time, but every so often, for no particular reason, the session fails and I get logged out (at least I know that part of my app works). I checked the error logs and it doesn't show anything. The database table is fine (doesn't need to be repaired or anything), so I'm at a loss.

I'm running my app locally through XAMPP and was wondering if anyone had ever had similar issues like this. Any help or even being pointed in the right direction would be fantastic!

Can you spot any sort of pattern, such as X minutes after creating the session, after accessing a certain controller/function etc?

[eluser]Zeeshan Rasool[/eluser]
same problem is happening to me in my current site and i also faced it before. Have you checked it online OR if you're checking it online then check it locally. Bcoz when i have this problem locally then its fine online. So check and confirm..


Are you calling on $_SESSION directly, storing strange characters such as backslashes, or storing more data than a cookie can hold (4KB)?


After I posted the message, I started writing some stuff down about when and where it's happening. The where is pretty random as is the when, but it dawned on me that I've only ever had this issue on XAMPP. I told some of my testers to keep an eye for the issue and none of them have seen it, so it's possible this is just a problem with XAMPP. I'll try to reproduce the problem on a live server.


I'm using CI's built-in session library and storing everything in the database, so none of those should be issues. I'm storing slashes, but not backslashes.

Thanks for the responses, folks! I'll dig a little more and see what I can come up with.

Can you remember what request you were making at the time? I'd imagine it's a call to a specific controller method that causes it.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.