I have created a cookie using the JS-Cookie package and it is saved in my browser, but the cookie is not set in my request header and is not sent to the server.
I use Axios.
My cookie example:
Cookies.set("myCookie", JSON.stringify(myData), {
expires: 2,
sameSite: "none",
secure: true,
});
Example of my Axios code:
axios.get("mayUrl", { withCredentials: true,});
I can send a cookie to React from the backend, but when I create a cookie in React, I can't send it to the backend. It seems that the browser ignores my cookie.
Thank you to those who help me