Welcome Guest, Not a member yet? Register   Sign In
value session_data field in ci_sessions table is NULL - Why?
#1

[eluser]moonbeetle[/eluser]
Hi,

I did some testing with both the OB Session library as well as the NG Session library for a user authentication. The field "session_data" in the "ci_sessions" table is used for storing user data (stuff like: firstname, lastname etc.) in a serialized way.

I noticed after a while that for some rows in my ci_sessions table, the value for the session_data field is NULL. I'm wondering why this is.

Is it because a session regeneration occured? (I set the config to 300 seconds)
Is it because a session was destroyed?
Is it because a there's a problem with the session cookie for certain users?
#2

[eluser]webthink[/eluser]
I would say most likely option a)
If a new session record is generated the old one is abandoned and left to expire. If you've not written any userdata to it prior to the record being abandoned then it'll remain this way. If what you're saying is that the *same* record (identified by session_id) had session_data at one point and then later appeared to have none that would definitely be something worthy of investigation.
#3

[eluser]moonbeetle[/eluser]
What I'm trying to figure out is why my user authentication seems to fail for some users.
For me it works great, every time I login. But for users Bob and Jeff it doesn't. Bob and Jeff both work at he same company and their internet access is most likely monitored. They both have their own PC.

When user Bob is authenticated he should get a greeting saying "Hello Bob,". Most of the time this works but sometimes he gets a greeting "Hello Jeff,". So I'm trying to figure out if it's a caching problem, a bug with the NG Session library, a problem with cookies not being stored properly or just me having written bad code.
#4

[eluser]xwero[/eluser]
Stupid questions first. Do they have the same login data?
#5

[eluser]webthink[/eluser]
Strange indeed. I will say that We've built apps using OB Session and more recently NG Session and never experienced anything like that.

Perhaps post a few snippets of your authentication code.
#6

[eluser]moonbeetle[/eluser]
@xwero, it's very unlikely that they have the same login as the login/password is auto generated and users cannot change it.

At first glance, the problem appears to be solved. Here's what I did:
- upgraded my application to CI 1.6.1 (although I don't think that did the trick)
- replaced the session library with NG Session library
- set the session regeneration time to 600 sec to reduce overhead




Theme © iAndrew 2016 - Forum software by © MyBB