I can't set the SameSite attribute of the cookie to None in Nodejs (Express)
I was able to self-resolve and will describe how I was able to solve the problem.In the code there are two sessions and a cookie session, but I decided to use the cookie session as it seems to work fine.The end result is the following
var cookieSession = require("cookie-session");app.set('trust proxy', 1)app.use( cookieSession({ name: "__session", keys: ["key1"], maxAge: 24 * 60 * 60 * 100, secure: true, httpOnly: true, sameSite: 'none' }));
try SameSite: 'none'
with capital S it worked for me but i used express-session with cookie-parser... i think your code not working because of small s, when i change my to sameSite it's not working for me too, but SameSite works just as expected
also i use npm i cors
here is my piece of code
app.use(session({ key: 'session_cookie_user_auth', secret: 'mooncore', store: sessionStore, resave: false, saveUninitialized: false, cookie: { SameSite: 'none', maxAge: 1000 * 60 * 60 * 60 }}));