pengu Posted September 13, 2010 Share Posted September 13, 2010 PHP + MySQL This has been doing my head in, it has to be possible how I think it is. The thing I am trying to achieve here is let's say a list of users logged in. Now if every one would click logout and use the system correctly the world would be a better place, but they wont, we all know this. So I was thinking how to counter this and I came up with an idea, lets say in our users table we have an "ACTION" field as a timestamp (or datestamp??). So everytime the user does anything on my site, edit there profile, browse something etc etc, it updates the "ACTION" field to the current time. I was thinking in the background I could have a cron job run every.. 5 minutes? Is it possible to have it check EVERY users ACTION field and if there ACTION field is less than the current time - 5 minutes, it updates there LOGGED_IN field to like 0, which would mean they're actually not logged in anymore and would not appear in the logged in list. Someone tell me yes or no! (The main problem being having to constantly update that ACTION field) Quote Link to comment Share on other sites More sharing options...
fortnox007 Posted September 13, 2010 Share Posted September 13, 2010 I haven't got a better idea than yours yet, but I subscribed to this topic Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.