how to set and get the cookie in nodejs http use jwt without express?

Viewed 22

when I set the cookie in this way: res.writeHead(200, { 'Set-Cookie': access-token=${token}, }) how can I get the cookie in another request ?

1 Answers

If the cookie was set, then you should be able to get the cookie in the request header.

console.log(request.cookies);
Related