B
B
bpGusar2019-06-17 15:19:30
Express.js
bpGusar, 2019-06-17 15:19:30

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);

but no cookies are set on the front. not even in the answers. and if you look through the postman, then everything seems to be normal.
How to make cookies on the front set?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question