How "Who is online" widgets work?

Discussion in 'PHP' started by shubhamjain, May 9, 2010.

  1. #1
    Can someone tell me how these widgets work? How they know if the user has gone offline?
     
    shubhamjain, May 9, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    I'll try to explain it as simple as possible:

    Each person has a unique (in most cases) IP provided by their isp/internet provider, this IP is recorded nearly on every site you access online to help indentify you, theirfore to track who is online its recorded along with the time accessed (and a few other browser powered values), and then the IPs recorded are all selected where the recorded time matches the current time/or close to which = total users/people online.

    Summary:

    It counts the IP's online which the time these IP's were online is the same as the current time (or not far off).
     
    danx10, May 9, 2010 IP
  3. live.co.uk

    live.co.uk Banned

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    there is many ways
    such count the ip onlines with a number of minuets
     
    live.co.uk, May 9, 2010 IP
  4. shubhamjain

    shubhamjain Active Member

    Messages:
    215
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    63
    #4
    Ok correct me if wrong. The widget registers the IP and counts it into online poeple and if the in the next 1 minute the smae ip doesnt show up to another page it considers him to be offline.
     
    shubhamjain, May 11, 2010 IP
  5. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
  6. organicCyborg

    organicCyborg Peon

    Messages:
    330
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You can also use a cookie based method for doing this. I think it works equally well as the method others have mentioned about tracking active IP addresses on the site.
     
    organicCyborg, May 11, 2010 IP
  7. Lam3r

    Lam3r Active Member

    Messages:
    235
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #7
    In addition to the ip method and cookie method, you could count session id's since each is unique, it's probably more accurate than an IP counter.
     
    Lam3r, May 11, 2010 IP