title: Set token value for redirect express.js
body: <p>How can I set a Authorization header in an expressjs response so that it is available on the redirected page?</p>
  
  <p>In my routes.js:</p>
  
  <p><code>
  res.set('access_token', token);
  res.redirect("/dashboard");
  </code></p>
  
  <p>Background:</p>
  
  <p>I am trying to get a user login working for my node spa application using Bearer tokens.
  To have another layer of security I splitted the signup/login process out of my angular application.</p>
  
  <p>To simplify here let's assume we have an user already registered and the client-side part of the application consists of two routes:</p>
  
  <p><code>
  /login --&gt; static resource with a form that posts to /auth
  /dashboard --&gt; single page application, we should get redirected here with our bearer token on successful login; from here, we intercept all XHR within our SPA
  </code></p>
  
  <p>So far, all is working except the redirected page doesn't contain the access_token header, hence the spa route just get blocked in my middleware (like a non authorised request).</p>
  
  <p>Thanks!</p>