Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!