0

I am setting cookie like this:

res.status(statusCode).cookie("access_token", token, {httpOnly: true, maxAge: 2 * 60 * 60 * 1000, path: '/', sameSite: 'none', secure: true}

and in server.js had set the CORS functionality like this:

app.use(cors({ credentials: true, origin: true }));

But in the browser I am getting this error:

Indicate whether a cookie is intended to be set in a cross-site context by specifying its SameSite attribute

What I am missing here?

jonrsharpe
  • 107,083
  • 22
  • 201
  • 376
Tanmoy Sen
  • 31
  • 5
  • Maybe this is what you're looking for: https://stackoverflow.com/questions/66503751/cross-domain-session-cookie-express-api-on-heroku-react-app-on-netlify/66553425#66553425 – JakeAve Feb 18 '22 at 16:47

0 Answers0