Results 1 to 10 of 10

Thread: User Online

  1. #1

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    User Online

    What is the best way of doiing so ?

    I could use the Session_OnStart in the global.asa, but if the user and session cookie turned off, which IE6 have by default, it just keep counting !!

    I could use IP address, but what if it's 2 user from the same network, like at my job !!

    What do you use ?

    Tx

  2. #2
    Lively Member
    Join Date
    Sep 2002
    Location
    chile
    Posts
    74
    i really think you need to elaborate a little bit on what it is you are trying to do, if not nobody's gonna be able to help you!

  3. #3
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: User Online

    Originally posted by sebs
    What is the best way of doiing so ?

    I could use the Session_OnStart in the global.asa, but if the user and session cookie turned off, which IE6 have by default, it just keep counting !!

    I could use IP address, but what if it's 2 user from the same network, like at my job !!

    What do you use ?

    Tx
    For the exact reason you mentioned i dont use session, and use IP aadress instead, but i have not taken into consideration that different users can have same IP address when they r on same network.

    I would be interested to know if you find a way to differentiate between those users.

    Thanks

    Danial
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  4. #4

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    Hi Danial !

    I'm still thinking about how to do it !

    When i'll find a solution i will post it here for sure !

    Here's my website for the interested

    http://www.frenchconnexion.org

    It's in french, so sorry for the one that can read french !

  5. #5
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994

    hmm

    Youre trying to do a user count ?
    hmmmm
    a friend of mine, Geemark, knows how to do this, he uses it on his own sites, i would suggest asking him!
    His homepages:
    www.battlemaniacs.net
    www.geemark.com

    his email: [email protected] !

    Cheers !
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  6. #6
    Lively Member Geemark's Avatar
    Join Date
    Aug 2002
    Location
    At the pc wasting my worthless time
    Posts
    89

    Put this in Global.asa / Global.asax

    VB Code:
    1. Sub Session_OnStart
    2.     Application.Lock
    3.     Application("UserCount") = Application("UserCount") + 1
    4. format.
    5.     Application.Unload
    6. End Sub
    7. ¨
    8. Sub Session_OnEnd
    9.     Application.Lock
    10.     Application("UserCount") = Application("UserCount") - 1
    11. format.
    12.     Application.Unload
    13. End Sub

    now on the page where you wish to display the number of users do like this:

    Users online now: <%=Application("UserCount")%>

    Please notice that 20 minutes (or whatever your Session.Timeout value is set to) will pass by before the Session_OnEnd event is fired. Therefore the number generated is not entirely accurate!

    Hope this helps.
    Machine Language: You try to shoot yourself in
    the foot only to discover you must first reinvent the
    gun, gunpowder, the bullet, and your foot.

  7. #7

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    tx !

    but try that if you have session cookie disabled, which IE6 seems to have by default !

  8. #8
    Lively Member Geemark's Avatar
    Join Date
    Aug 2002
    Location
    At the pc wasting my worthless time
    Posts
    89
    I can imagine it would count like crazy...

    However, most standard browser-installations do have session-cookies enabled by default, including IE6. The option does not say "allow" it says "always allow", so even if it is not checked, it will in most cases (not always) be active.

    Anyways, thinking of the nature of HTTP server to client traffic there is no way to detect how many users are currently on the website other than this unsafe one!
    Machine Language: You try to shoot yourself in
    the foot only to discover you must first reinvent the
    gun, gunpowder, the bullet, and your foot.

  9. #9

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    yeah you're right !

    but i still don't like that way

    i tried it on my website and at some point it show like 120 user online, which i doubt !

    i like the IP thingy, i just need to find something unique from a computer to another, to prevent the users on the same network counting as one !

    do you have any thoughts on this ?

  10. #10
    Lively Member Geemark's Avatar
    Join Date
    Aug 2002
    Location
    At the pc wasting my worthless time
    Posts
    89
    I used the code i showed you on battlemaniacs.net for a long time. At the time there were just about 400 visitors per day, and we only experienced the counter to go mad 1 or 2 times, but for a different reason.

    I have no ideas for your suggestion
    Machine Language: You try to shoot yourself in
    the foot only to discover you must first reinvent the
    gun, gunpowder, the bullet, and your foot.

Posting Permissions

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



Click Here to Expand Forum to Full Width