Active user counting

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • navaneethkn
    New Member
    • May 2007
    • 5

    #1

    Active user counting

    Hello

    I need to count how many users are active in the website. Do you have any idea on this. I did using application variable. On session_start event in global.asax I am incrementing the application variable count and session_end event I am decreasing the count. But problem is when user closes browser no event will be fired. So I am not able to reduce the application variable count. It will show the old result. Do you know any method to handle this efficiently.

    I am changing the application variable like this

    Code:
    Application.Lock();
    Application["count"] = Application["count"]  + 1;
    Application.UnLock();


    I know lock method stops modifying the variable value at same time. But what will happen if two users request at same time ? Will the second request wait's till application variable get unlocked ? Or that request will be skipped ??
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Asp.net is server side so for each person running the request it will run.

    Comment

    Working...