User presence system design (user online/offline status)

I think it’s overcomplicated. Just have a page is loaded workflow, set the lastLogin date if the user’s last login date is more than 5 minutes ago, and then you have an easy way to show all online users (all users who have loaded a page in the last 5 minutes) - that’s pretty fine, I think, especially given that in SPAs, changes to URL params load the page again so will run the workflow if necessary.