Rare Earth Juejin Tech Community
Jul 11, 2024 · Backend Development
Implementing Online User Counting with Redis Sorted Sets (zset)
This article explains how to track online users by assigning each user a unique identifier, storing it in a Redis sorted set with an expiration timestamp, and using zadd, zrangeByScore, zremrangeByScore, and zrem commands together with browser fingerprinting to reliably count and clean up active sessions.
FingerprintJSJavaJavaScript
0 likes · 7 min read