Category : cookies

I’m setting an httpOnly cookie after login in a user with bcrypt. router.post(‘/login’, (req, res) => { User.findOne({email: req.body.email}, function(err, user) { if (err) throw err; if (user) { user.comparePassword(req.body.password, function(err, isMatch) { if (err) throw err; let token = jwt.sign({ id: user._id }, process.env.SECRET_KEY, {expiresIn: ’24h’}); res.cookie(‘token’, token, {maxAge: 60*1000, httpOnly: true, secure: true}) ..

Read more

I have a web application which creates a post request. When I send the post request the response contains mutliple "Set-Cookie"-Headers. {…. "name": "Set-Cookie", "value": "Cookie1=….; Path=/bi" }, { "name": "Set-Cookie", "value": "Cookie2=…; Path=/bi/v1" }, { "name": "Set-Cookie", "value": "Cookie3=…; Path=/bi" }, …. Unfortunately only the first two cookies are really stored inside the browser ..

Read more