title: NextJS: How to send data from one page to another page's getInitialProps function
body: <p>I'm trying to send data from Page B (login) to Page A's (index) <code>getInitialProps</code> as I need a key for Page A's getInitProps to actually get the props... </p>
  
  <p>I'm currently trying to do it by sending a POST request to a custom express route and use that route to render the Page server side so getInitialProps will run. But the problem is that the browser won't render the page even though it gets built server side.</p>
  
  <p>POST Request From Login Page (happens Client Side):</p>
  
  <pre><code>const headers = {'Content-type': 'application/json; charset=UTF-8'}
  await fetch(`${getRootUrl()}/loadKey`, {method: "POST", body: JSON.stringify({key}), headers})
  </code></pre>
  
  <p>Express Route:</p>
  
  <pre><code>server.post('/loadKey', (req, res) =&gt; {
      // const {key} = req.body
      // console.log(key)
      next({dev}).render('/') //index page
  })
  </code></pre>
  
  <p>The key gets logged fine and in the terminal, nextjs is saying that the index page is getting built,and getInitialProps gets ran, but nothing happens on the browser. No redirect. </p>
  
  <p>I've tried using <code>express.redirect</code>, <code>express.render</code>, and I've tried to force a client-side redirect, but for the former two, the same thing happens when I use next.render; the page gets built, getInitialProps runs, but no redirect happens on the browser. And when I force a redirect using Link or Router, then Index's getInitialProps won't get the key passed in from the POST request. </p>