Answer the question
In order to leave comments, you need to log in
How to set cookie to front from Express?
I have a login from the front and at the end on the back this happens
const payload = { email };
const token = jwt.sign(payload, secret, {
expiresIn: '1h',
});
res.cookie('token', token, { domain: '127.0.0.1:3000' }).sendStatus(200);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question