Search code examples
node.jsreactjsmerncross-sitesamesite

How can I make Set-Cookie warning disappear on MERN app?


so I have an app made with the MERN stack, and I set up the next code on my server.js

app.get("*", (req, res) => {
  res.setHeader("Set-Cookie", "HttpOnly;Secure;SameSite=Strict");
  res.sendFile(path.resolve(__dirname, "client", "build", "index.html"));
});

But I keep seeing on chrome the warning "A cookie associated with a cross-site resource at http://fontawesome.com/ was set without the SameSite attribute."

Some of my CSS is not working after build, so I don't know if that could be the affecting in some ways.


Solution

  • The cookie is associated with the fontawesome.com domain which means they are responsible for updating this attribute. The team there is aware of this issue and has updated their code. You can take a look at this issue on their GitHub for more context.