Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    PA
    Posts
    93
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Seeing whose viewing your site

    Hi,
    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)

    TIA

  • #2
    Regular Coder
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    112
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •