title: Express Session not Saving/Finding Session
body: <p>I am using express-session to try to use the session and it doesn't seem to find or save the session. </p>
  
  <p>I would expect the response to increment after each call however with repeated requests with Postman or a basic svelte app, it keeps returning 0.</p>
  
  <p>How do i get it to find the already saved session and return incremented values?</p>
  
  <p>Node.js:</p>
  
  <pre><code>const express = require('express')
  const app = express()
  const session = require('express-session');
  
  app.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "http://localhost:5000"); // update to match the domain you will make the request from
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();
  });
  
  app.use(session({
      genid: function(req) {
          return 1
      },
      proxy: true,
      secret: "max",
      resave: false,
      saveUninitialized: true
  }));
  
  app.get('/', function (req, res) {
      console.log(req.session)
      if (!req.session.views) {
          req.session.views=0;
      }
      res.send((req.session.views++).toString());
      console.log(req.session)
  })
  
  app.listen(3000)
  </code></pre>
  
  <p>Basic svelte:</p>
  
  <pre><code>&lt;script&gt;
      export let name;
      let resp = "";
      async function sendReq() {
          resp = await fetch("http://localhost:3000/");
          console.log(resp);
          resp = await resp.text();
          console.log(resp);
      }
  &lt;/script&gt;
  
  &lt;main&gt;
      &lt;h1&gt;Hello {name}!&lt;/h1&gt;
      &lt;p&gt;Visit the &lt;a href="https://svelte.dev/tutorial"&gt;Svelte tutorial&lt;/a&gt; to learn how to build Svelte apps.&lt;/p&gt;
      &lt;button on:click={sendReq}&gt;Click me&lt;/button&gt;
      {resp}
  &lt;/main&gt;
  
  &lt;style&gt;
      main {
          text-align: center;
          padding: 1em;
          max-width: 240px;
          margin: 0 auto;
      }
  
      h1 {
          color: #ff3e00;
          text-transform: uppercase;
          font-size: 4em;
          font-weight: 100;
      }
  
      @media (min-width: 640px) {
          main {
              max-width: none;
          }
      }
  &lt;/style&gt;
  </code></pre>