Page 1 of 1
Tracking which users are logged in (via database)
Posted: Tue Jun 13, 2006 1:41 pm
by Luke
I know I saw a topic about this and I looked around for it, but couldn't find it. I have a user privelege/admin panel for my file management system. I would like this panel to display which users are logged in. I really don't know where to start. So far all I've got is a "logged_in" column in my users table.
Where do i go next?
Posted: Tue Jun 13, 2006 6:42 pm
by RobertGonzalez
Usually, with my user driven sites, I will have a boolean field within the users table that turns on when they are logged in. That way I can see at any time who is logged in by querying the user table where user_logged_in = TRUE or something like that.
Posted: Wed Jun 14, 2006 3:13 am
by GM
I store my sessions data in the database, so I just look at the last time the session was updated, and if it was more recent than some arbitrary amount (say, 5 mins), I assume the user is logged in.
Posted: Wed Jun 14, 2006 11:20 am
by Luke
GM wrote:I store my sessions data in the database, so I just look at the last time the session was updated, and if it was more recent than some arbitrary amount (say, 5 mins), I assume the user is logged in.
Nice... thanks!