Knowing if a user is online in real-time is not possible without using WebSockets. What you can do is create an endpoint for polling and call it regularly every few seconds to fetch online users.
In your case, you could set the session in Redis to expire every 5 seconds, and every 4 seconds (as long as you are online), you call this endpoint to validate your session for another 5 seconds and fetch online users. This way, you achieve a real-time effect without WebSockets.