res.cookie set browser cookie on localhost but doesn't set browser cookie after production and still I can find set-cookie in response header. I don't see any cors problem. I use Digitalocean App to deploy my node server.
Here is my code -
res.cookie('ckstate', 'logged', {
httpOnly: false,
sameSite: router.get("env") === "development" ? true : "none",
secure: router.get("env") === "development" ? false : true
})
.status(200)
.json(others)
Here is the POST request from my React client -
await axios.post(API_URL, user, { withCredentials: true })
.then(res => {
Auth.refreshAuth();
history.push('/');
})
.catch(err => {
console.log(err)
setMessage('Wrong Credentials. Try again.');
})