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
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 ??
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 ??
Comment