I know it is quite easy to check when a user has logged in using the onLogin function or just by checking periodically if the user is still logged in. What I would like to achieve is to be able to display when a user is online and when he is not for a chat system. My problem is that I cannot find a way to track when a user leaves the site/logs out so that I can display him as “offline”.
Thank you for the help in advance!