title: Intercept login/logout ejabberd
body: <p>I want to know when a user is logged in and logged out from an ejabberd session in a custom module, without changing the ejabberd code.</p>
  
  <p>I need that because I have to execute some actions when a user logs in and clean up the actions I did when the user logs out. Also, I need to be able to logoff a user given some circumstances.</p>
  
  <p>So, is there a way to extend some module to get those feature? I'm still looking for some documentation that could help me with that.</p>