Why is req.cookies undefined?
问题 SITUATION: I am trying to check if my user is authenticated when he makes a request to the server. I googled a bit and found this: How to show different page if user is logged in via firebase So here's my try at implementing this solution using this library: https://github.com/js-cookie/js-cookie/blob/latest/src/js.cookie.js CODE: server-side var cookies = require("cookie-parser"); router.get("/", function(req, res, next){ const { token } = req.cookies; console.log('Verifying token', token);