I am using Codeigniter's Session class to store session values in the database. Contained within the userdata
field is the user's username and other values.
I want to get the username
from each userdata
field where the lastactivity
is >= let's say 5 minutes.
The only way I can think to accomplish this is:
- search for users active in last 5 minutes
- get the userdata for each row returned
- unserialise userdata
- extract username
However this seems like the long way. Is there a cleaner/better way to do this?