Welcome Guest, Not a member yet? Register   Sign In
Get all stored sessions
#6

(02-15-2016, 09:33 AM)vertisan Wrote:
(02-15-2016, 08:09 AM)Narf Wrote:
(02-15-2016, 06:45 AM)vertisan Wrote:
(02-15-2016, 05:49 AM)Narf Wrote: That all_userdata() doesn't do what you think it does.

So how can i do this? Normally foreach table from DB? If yes, so how can I get data from 'BLOB' column ?

You can't reliably read the "blob column" and you really shouldn't.

You need to otherwise map session IDs against user IDs, without trying to read the session data itself. There's no concrete answer to the "how to do this?" question - you can do it in many ways, none of which is easily explainable.

So whether it's a good idea to create another array, ex. 'Logged_users' and each login/logout respectively add/remove a record from the data it needs?

Something like that could work, but you're missing one detail - counting the auto-logouts when sessions expire.

Instead, you could add a field for the user ID in the sessions table and update it on login. However, you'd have to also extend CI_Session:Confusedess_regenerate() so the user ID is carried over when the session ID changes.
Reply


Messages In This Thread
Get all stored sessions - by vertisan - 02-15-2016, 04:20 AM
RE: Get all stored sessions - by Narf - 02-15-2016, 05:49 AM
RE: Get all stored sessions - by vertisan - 02-15-2016, 06:45 AM
RE: Get all stored sessions - by Narf - 02-15-2016, 08:09 AM
RE: Get all stored sessions - by vertisan - 02-15-2016, 09:33 AM
RE: Get all stored sessions - by Narf - 02-15-2016, 11:42 AM
RE: Get all stored sessions - by vertisan - 02-15-2016, 01:56 PM
RE: Get all stored sessions - by Narf - 02-15-2016, 03:44 PM
RE: Get all stored sessions - by vertisan - 02-16-2016, 06:54 AM
RE: Get all stored sessions - by Narf - 02-16-2016, 09:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB