I created a fairly comprehensive package to track all login sessions from each user, as well as their IP addresses and activity:
https://github.com/mizzao/meteor-user-status
To monitor the shutdown, you can simply do the following, which catches both exits and browser closures:
UserStatus.on "sessionLogout", (userId, sessionId) ->
console.log(userId + " with session " + sessionId + " logged out")
You can also check the code and do something similar for yourself.
source
share