Em Tuesday 04 March 2008 06:38:17 Patrick Lewis escreveu: > On Mar 4, 1:52 am, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > How find number of logged in users if they don't log out properly? > > > > My only guess would be to count the number of session objects in > > memory....I just can't figure out how to deal with people that don't > > log out explicitly. > > > > Chris > > In SQL it would be something like > > SELECT count(*) > FROM visit v > Inner join visit_identity vi on v.visit_key=vi.visit_key > Where > vi.expiry > current_timestamp > > Basically, check for visit sessions that haven't expired.
But I believe he was talking about users that are really there, not the ones that have simply closed the browser and gone home, without clicking on "Logout". With your query those will be counted as if they were logged in. To the OP, other than the above you will never know for sure. The way the web works prevents you from that. You can, though, reduce the timeout a lot and use JavaScript to keep the session alive, but then you might hurt users on slow links. This will "disconnect" users that aren't logged in anymore (switched URLs on the same window/tab of their browser, closed the browser, disconnected from the network, etc.) and will give you something more accurate but still inexact at a certain time. -- Jorge Godoy <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

