I deployed my backend using DigitalOcean, and frontend using Vercel, utilizing socket.io. I’m not sure if this information is relevant. After the login process, I send a token to the user, which I store using res.cookie. Later, within the app, I use react-cookie to handle these credentials. However, during the deployment process, everything works correctly, but at the production level, the app doesn’t function as expected. Although the cookie is being set in the browser, I’m unable to retrieve it and perform operations with it.
` res.cookie(“token”, token, {
httpOnly: true,
secure: true,
sameSite: “none”,
maxAge: 30 * 24 * 60 * 60 * 1000, // expiresIn 30 days
});
console.log("Token from cookies js-cookie package:", token);
console.log("Token from cookies document object:", document.cookie);
console.log("Token from cookies config:", cookies.token);`
I’ve tried every method to see the cookies in the console, and I’ve even attempted using a different package like js-cookie, but I still can’t retrieve the cookies! Where could the issue be originating from?