Some administrators noticed that APG vNext was showing a higher-than-expected number of online users, or the count was not updating correctly.
Common Causes
Search Engine Bot Traffic
By default, search engine crawlers (Googlebot, Bingbot, etc.) may be counted as online users. APG vNext 4.4+ can filter known bots automatically:
- Go to Admin Panel → Settings → Online Users.
- Enable Filter Search Engine Bots.
- This uses a built-in user agent list to identify and exclude crawlers from the count.
Session Timeout Too Long
If the session timeout is set very long (e.g., 60 minutes), users who have closed their browser are still counted as "online" until the session expires:
- In Admin Panel → Settings → Online Users, set Online Threshold to a shorter value (e.g., 15 minutes).
- Also update the ASP.NET session timeout in
web.configto match.
Cached Counter
APG vNext caches the online user count for performance. If the count seems stale, clear the application cache from Admin Panel → Tools → Clear Cache.
How APG vNext Tracks Online Users
The online user display in APG vNext is driven by session activity records stored in the database. Every request from a registered member or anonymous visitor updates a row in the tracking table with the current UTC timestamp and the user identifier (or a guest token). The forum then queries this table and counts all rows where the last-seen timestamp is within the configured online threshold window.
This design is simple and effective for low-to-medium traffic forums, but it has several edge cases that cause the displayed count to diverge from the true number of active humans browsing the site at any given moment.
Bot Traffic Inflating the Count
Search engine crawlers and other automated bots generate large volumes of HTTP requests. Googlebot alone can make hundreds of requests per hour on an actively indexed site. If the bot-filtering feature is not enabled, every bot request creates or refreshes an online-user record, dramatically inflating the displayed count. In extreme cases, a site with 5 real users simultaneously online might show 200+ due to crawler activity.
APG vNext 4.4 introduced an improved bot detection list. After upgrading, go to Admin > Settings > Online Users and confirm Filter Search Engine Bots is checked. This setting compares the incoming HTTP User-Agent header against a maintained list of known crawler signatures. Any request matching the list is processed normally but does not update the online-user tracking table.
For bots not in the built-in list, you can add custom exclusion patterns. Edit the bot signature list file located in the APG vNext configuration directory and add the relevant User-Agent substrings, one per line. Restart the application pool after saving changes for the new patterns to take effect.
Session Timeout Configuration Mismatch
A common misconfiguration is having the APG vNext online threshold set to 30 minutes while the ASP.NET session timeout in web.config is set to 20 minutes. In this scenario, users whose ASP.NET sessions have expired are still counted as online by APG vNext because their tracking record has not yet aged out. The two values must be coordinated:
- Set APG vNext Online Threshold (in minutes) to be equal to or less than the
web.configsession timeout. - Typical recommended values: 15 minutes for an active community, 20-30 minutes for a lower-traffic forum.
- Values above 30 minutes are rarely appropriate and significantly degrade the accuracy of the online count.
Application Cache Staleness
The online user count query is cached in ASP.NET application memory to avoid hitting the database on every page load. The cache lifetime is configurable. If you recently enabled bot filtering or changed the online threshold and the displayed count has not updated, the old cached value is still being served. Use Admin > Tools > Clear Cache to flush all application caches, or wait for the cache lifetime to expire naturally (typically 60 seconds by default).
Diagnosing Unusual Counts
If the count is unexpectedly high or persistently wrong after applying the above fixes, a direct database query can reveal what is actually in the tracking table:
SELECT COUNT(*) AS total,
SUM(CASE WHEN user_id IS NOT NULL AND user_id > 0 THEN 1 ELSE 0 END) AS members,
SUM(CASE WHEN user_id IS NULL OR user_id = 0 THEN 1 ELSE 0 END) AS guests
FROM aspx_online_users
WHERE last_activity >= DATEADD(MINUTE, -15, GETUTCDATE());
Replace aspx_online_users with your actual table name and adjust the 15-minute window to match your configured threshold. This query bypasses the application cache and shows the raw count the forum would display if the cache were cleared. If this number is still inflated, inspect the individual rows to identify which IP addresses or user agents are responsible.
Ghost Sessions from Load Balancers
On hosted environments with multiple web servers or a load balancer, session affinity (sticky sessions) must be configured correctly. Without sticky sessions, the same user may appear as multiple distinct sessions if different requests land on different servers, each of which maintains its own in-memory session state. In APG vNext deployments without a centralized session provider (such as SQL Server session state or a Redis session provider), this can cause the online user count to multiply by the number of backend servers.
To fix this, either enable sticky sessions in the load balancer configuration, or switch APG vNext to use SQL Server session state by updating the sessionState element in web.config:
<sessionState mode="SQLServer"
sqlConnectionString="Data Source=sql-server;Initial Catalog=ASPState;..."
timeout="20" />
Best Practices for Accurate Online User Display
For the most accurate and meaningful online user count in APG vNext, follow these guidelines. Enable bot filtering immediately after installation and verify it is still active after every major upgrade, as some upgrades reset settings to defaults. Set the online threshold to 15 minutes for active communities — shorter windows are more accurate and put less load on the tracking table. Periodically run the diagnostic query above as part of routine maintenance to spot anomalies before they are noticed by members. If your forum runs on SQL Server, consider adding an index on the last_activity column of the online users table to speed up the count query on high-traffic forums.
Looking for more help? Browse the support forum or check the Knowledge Base.