On my server.js (main launch file) I'm using express and cookie-parser for cookies.
const cookieParser = require('cookie-parser');
.....
app.use(cookieParser());
And on my router file I'm setting the cookie
router.get('/auth', function (req, res, next) {
res.cookie('lcuser', crypto.randomBytes(32).toString('hex').toUpperCase(), {
domain: config.domain,
expires: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000),
httpOnly: true
});
res.writeHead(302, {Location: config.domain});
res.end();
});
but when going trough the url http://localhost:1110/auth it does redirect to main page but doesn't set the cookie. Where the problem could be?