title: Get headers on page load from node-express app?
body: <p>I am building an app with node and express and set it up such that when the page loads, some headers are sent to the client.  How do I extract that information on the client side?  I am using JS/jQuery on the client side.  Here's the code in question-</p>
  
  <pre><code>app.get('/', (req, res) =&gt; {
    models.game_session.build({
      sid: req.sessionID
    }).save().then((data) =&gt; {
      let options = {
        "root": __dirname,
        headers: {
          "x-sid": data.id
        }
      }
      res.sendFile('/index.html', options, (err) =&gt; {
        if (err) {
          res.send(err)
        }
      });
    }).catch((e) =&gt; {
      res.send(`There was an error`);
    });
  });
  </code></pre>
  
  <p>I am saving the session ID in the database then sending the index file to the client.  As you see in the options object, I want to include the session ID in the header to be sent with the index file.  How can I retrieve that info on the client side?  I'm not sure if I am going about this in the right way- appreciate any help!</p>