I want to send the jwt with a cookie but I can't see it in the browser.
This is the route that sends the cookie:
router.post('/signup', async (req, res) => {
const { email, password } = req.body
try {
const user = await User.create({ email, password })
const token = createToken(user._id)
res.status(201).cookie('jwt', token, { httpOnly: true, maxAge: maxAge * 1000 })
} catch (err) {
const errors = handleErrors(err)
res.json({ errors })
}
})
I can't see the 'jwt' cookie in the chrome application tab.
I'm sure that the server works perfectly.
I'm sure that the token size is less than 4kb.
I'm using express 4.17.1.