title: Sails.js: Track logins
body: <p>I'm using Sails (0.11.0) and Passport (0.3.0) for a project. I can't figure out a way to log each login/logout activity.</p>
  
  <p>From what I gather, this will probably require adding some code in the <code>login</code>/<code>connect</code> functions inside the <code>local</code> protocol or <code>passport</code> service, but I'm totally clueless about the specifics.</p>
  
  <p>To avoid creating an xy problem, here's what I actually want to do: track the last logout time of a user so I can generate notifications for him/her on the next login (based on the activities that took place in the interim).</p>
  
  <p>(Sure, I can work around the notification-collection procedure and probably maintain a cache of activities from subscribed sources per user, but I'd like to explore this way of doing it since it doesn't involve the storage overhead.)</p>
  
  <p>Not sure if there's any relevant code I can share.</p>
  
  <p>Any help would be appreciated. Thanks in advance!</p>