I'm having problems with client-side session creation, the browser doesn't save the session ID

18 views Asked by At

Context: In the API I am working with express-session in NodeJS to create the sessions, I am just testing, therefore the sessions are stored in memory on the API side, I am using two different domains for the API and the client, none are HTTPS because I'm working with local domains. I'll leave the session and cors configuration below. As additional information, the FireFox console displays the following message "the cookie “connect.sid” will soon be rejected because it is external and does not have the attribute “Partitioned“".

app.use((req, res, next) => {
  res.append('Access-Control-Allow-Origin', 'http://localhost:3000');
  res.append('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
  res.append('Access-Control-Allow-Headers', 'Content-Type');
  res.append('Access-Control-Allow-Credentials', 'true')
  next();
});

app.use(session({
      secret: "secretadsfad",
      resave: false,
      saveUninitialized: true,
      cookie: {
          rolling: true,
          httpOnly: true, 
          SameSite: 'none', 
          secure: false,
        },
}))
0

There are 0 answers