Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

198
Visualizações
node js session doesn't persist if the client is on a different domain

I have a server node js and a client vue js.

The client can be called from 2 domains. example:

client.domain1.de

client.domain2.de

The server is available in the same domain as one of the clients. example:

server.domain1.de

In the node js application, I have Express using middleware session and I store login information on the session.

If I call the server from the domain1 the same domain client and server it stores just fine.

if I called the server from a different domain domain2 the session is not stored.

the session is configured in such way:

export default session({
  store: new RedisStore({ client: redisClient }),
  secret: my-secret,
  saveUninitialized: false,
  resave: false,
  name: my name,
  cookie: {
    secure: true, 
    httpOnly: true,
    maxAge: my age,
    sameSite: 'lax',
  },
});

Note that I am not talking about the cookie but instead extra session variable

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda