Executing code when a session ends in sails.js
<p>Using <code>sails.js</code>, is there a way to run a function when a user session expires or is finished? Some configuration to do in <code>config/session.js</code>?</p>

<p>I know exists <code>session.destroy</code>, which you can set a function to execute when the session is destroyed, but I need it to be a global unique function for the application.</p>

<p>The idea would be writing in db table the state of a user as offline, when it's session ends.</p>

<p>Thanks.</p>