View Full Version : Seeing whose viewing your site

10-20-2004, 06:25 PM
I have a site that uses sessions and cookies, when a user visits my site i store their ip in my database to see whose currently viewing the site.... currently im also storing the time they visited a certain page (updating the tuple with the current time everytime they visit another page).... then to see whose online i query this table and check which ip's are there within a 3 minute span.... what i was wondering... is there a way for me to delete the tuple once the visitor or member leaves the site... a delete query that will occur when the session is destroyed? or is there a better way to doing this other than having a sql update on every webpage

(i searched the forum and didnt find a solution)


10-21-2004, 05:13 AM
not sure if its a better solution, the way I do is to delete all records in the database where the ip address match, each time the user visits a page, then insert the new page, ip and time into the db.

I'll set a timer of about a few minutes and if there is no new record in the database, I assumed the user is out of the site.