NodeJS express response cookie does not set cookie in client.
Jun 6, 2021
In your NodeJS, you declare to respond with a cookie in its header:
response.cookie("accessToken", accessToken, {
expires: new Date(Date.now() + 60_000), // 60 seconds
}
But the client does not save cookies from its reponse header because you must specify withCredential
in your axio configuration:
const instance = axios.create({
baseURL: 'http://www.google.com',
withCredential: true
});