Seeking effective methods to determine a user's online status
I am currently employing an inefficient technique to address this issue: I continuously send AJAX requests to the server at set intervals using setInterval
, allowing the server to gauge the user's online presence based on the request timestamp.
Although I acknowledge that this method is suboptimal and results in unnecessary consumption of Internet bandwidth and places strain on the server, it remains the simplest way to achieve the desired functionality.
With that said, I am open to suggestions or alternative approaches from those with better ideas.