title: How are XMPP/ejabberd login sessions represented/maintained in each message sent? How does it compare to PHP Sessions?
body: <p>I'm having a hard time trying to understand how a user can send a message after login since there is no exchange of a session token or any other kind of token.</p>
  
  <p>For example, in PHP after you login a user, a Session ID is created for him which is stored in a cookie, and then everytime he visits a page, that Session ID is retrieved from the cookie, identifying him.</p>
  
  <p>How does this work with XMPP/ejabberd since no token is exchanged after authentication?</p>
  
  <p>I found this:</p>
  
  <blockquote>
    <p>Session Manager: 
    This module routes packets to local users. It searches for what user resource
    packet must be sent via presence table. If this resource is connected to this
    node, it is routed to C2S process, if it connected via another node, then the
    packet is sent to session manager on that node.</p>
  </blockquote>
  
  <p>... but I'm not sure it is related to my question and even if it is, I still don't get how does this relate to the login the user just made.</p>