I'm trying to set an httpOnly cookie using expressJs res.cookie method but while it is being set on postman, it is not being set in either chrome or firefox. This situation is simply baffling and all I've done to debug the problem has been to no avail. Here is the code that sets the cookie
const refreshJwtExp = 30 * 24 * 60 * 60
return res.cookie('refresh_token', genRefreshJWT(id).token, {
maxAge: refreshJwtExp,
httpOnly: true
})
Here is the client environment I'm working with:
- Nuxt Js using @nuxt/axios for API request
- Running at www.roromart.com
Here is the backend API I'm working with
- Express Js node powered backend
- Running at roro-api.herokuapp.com
Here are the things I've tried to debug the problem
- Use security disabled chrome version. See here. I managed to get the refresh token setting on localhost but not on the production website https://www.roromart.com
- add "domain" set to "roromart.com" property in res.cookie config. Didn't work
I'm thinking this is a security problem since it's setting in postman and a security-disabled variant of chrome. One peculiarity here is I'm working with two domains (roro-api.herokuapp.com) and www.roromart.com. Any help would be much appreciated