title: How can I get sessionId from a request?
body: <p>I use express to support my session management:</p>
  
  <pre><code>app.use(express.cookieParser('your secret here'));
  app.use(express.session({secret: 'mysecretcode'}));
  </code></pre>
  
  <p>I what to extract and save the sessionId from the request. However, the id I get from req.sessionID is different to that sent in the cookie:</p>
  
  <pre><code>req.sessionID --&gt; 'E7oSoKmQfcMKnk5_jA5tF5vR'
  cookie.connect.sid --&gt; 's%3AE7oSoKmQfcMKnk5_jA5tF5vR.DQnYdDDcFn8K2JJHMgWL5DTzNYYwIU3DA5a10WImA7U';
  </code></pre>
  
  <ol>
  <li>Why these two are different?</li>
  <li>How can I get connect.sid before sending a response?</li>
  </ol>