Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.
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.
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.
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.
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.