Posted by pmorel@gmail.com on 11/18/69 11:40
You can remove the inactive user when any user load their page. For
each page, simply call a function 'refresh' that does:
function refresh() {
// remove all inactives user
DELETE FROM session WHERE last_heard_of > 15 minutes
// Verify that the current user is still active
SELECT * FROM session WHERE user=xxx
// refresh the current user if still active
UPDATE session SET last_heard_of = now WHERE user= xxx
}
That's a simple way to clean your database.
Navigation:
[Reply to this message]
|