We're currently looking for best logout system, which will not be bad for performance. * we logout users with a link it's ok. * ...but as you know most users don't use logout link. * we can use a Javascript, which can check if the [X] of browser is clicked, I mean when the browser is closed. We'll do it. But: i. It has cross browser problems. ii. It's not a guarantee. We should somehow trace "last-logout" time, timestamp or datetime... We don't want to trace users by updating "lastLogin" it's very costly to work an SQL in every refresh. It needs Cron Job and AJAX check. But we couldn't model a good-performance logout system. And good-model offer?
Well... updating a "last activity" row with every page load isn't as bad as you may think. vBulltin does it and many many others. If you LIMIT your query to 1 so that it stops searching the other rows after the first match, you'll get best performance, and it's just a small query which doesn't hurt anything. Digitalpoint has 1,783 users online right now, and it's using the database system... do you have more than that? Plus, I'm afraid that's the only way to go about this...