Thanks a lot, this is a pretty good way, My site gets about 800-1000 unique users a day, but those unique users are almost always the same coming back the next day. So maybe a cron job once per week would be fine, well I'll monitor and reduce time if the select becomes long.
Thanks again Etienne Daniel Gardner wrote: > > EM> What is the best method for a Who's online type of thing? > > EM> Users can either log in or be automatically logged in with a cookie on > EM> the site. > > EM> How can I "see" when the user is "there" or "gone" > > EM> Am I better of reading a text file or a database table? > EM> With a cron to update every x minutes the number/handles of the users? > > the way i'd probably do it would be to update a database table every > time a user logged in. the table could have (username, last_access) > > there is no real way with HTTP to see id a user is "there" or "gone", > the only way you can tell is if a user has not accessed any pages for > x minutes... say if they haven't accessed for 10 minutes they are > "gone". > > so, on all of your pages have a function to update the "last access" > table, and when you want to see who is "there", do a select from the > table where last_access > 10 minutes ago > > if you have only a few users then this will be okay, but if you have > lots of users then a cron job to delete records where the user > hasn't accessed for more than 10 minutes running once a day or > something would be good. > > hope that gives you some idea of a way to start... > > -- > Best regards, > Daniel -- Etienne Marcotte Specifications Management - Quality Control Imperial Tobacco Ltd. - Montreal (Qc) Canada 514.932.6161 x.4001 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
