Hi friends,
How to Find the no of simultaneous users logged in to a web site at a time?.
Any help with the C# code will b greatly appreciated.
Regards
Robins
Hi friends,
How to Find the no of simultaneous users logged in to a web site at a time?.
Any help with the C# code will b greatly appreciated.
Regards
Robins
Define what "simultaneous users logged in" means (authenticated accounts with recent activity, active sessions, or concurrent TCP connections). A reliable approach is to treat "logged in" as accounts with a recent server-side heartbeat and record a last-activity timestamp for each authenticated user. This avoids guessing from page hits or open sockets.
As suggested, a simple file counter is possible but brittle (race conditions, process crashes, no cleanup). As noted, IIS logs and analytics give useful traffic/peak estimates but do not prove who is currently authenticated. Prefer one of these patterns:
Do not rely on Global.asax Session_End for general tracking: Session_End fires only for InProc session-state and will not work reliably with out-of-process session modes or in web farms (). Keep implementation atomic, handle logout and abrupt disconnects via timeouts, and choose a storage solution that matches the app topology (in-memory for single process, distributed store for many servers).
Jump to Post— skatamatic 371Hi friends,
How to Find the no of simultaneous users logged in to a web site at a time?.
Any help with the C# code will b greatly appreciated.
Regards
Robins
Is this for a website of yours? Or just in general? If it is yours, then when you run …
Hi friends,
How to Find the no of simultaneous users logged in to a web site at a time?.
Any help with the C# code will b greatly appreciated.
Regards
Robins
Is this for a website of yours? Or just in general? If it is yours, then when you run the script for loggon (probably php) have the script update a file with an incremented number of users, and conversely decrement it when someone logs off. Then if you choose to use C#, have it open this file and read the number...
There's any number of ways you can do this-- if you're not actually keeping track of users logged into the site, you can really only track things through IIS, like page hits per hour, etc, with some type of analytics software.
How are you keeping track of when users log in?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.