title: How to access session in express, outside of the req?
body: <p>I know that I can use </p>
  
  <pre><code>function(req, res) {
      req.session
  }
  </code></pre>
  
  <p>using express.  However I need to access the session outside of the response function.  How would I go about doing that?</p>
  
  <p>I'm using socket.io to pass information for adding posts and comments.  So when I receive the socket.io message on the server-side, I need to verify the person posting the information by using the session.  However since this is being done via socket.io there is no req/res.</p>