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