req.cookies is showing null
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- express, javascript, node.js
Research direction
The report names an unnamed token-validation middleware and the app.js /test route; start by reproducing the login and validation request and compare the two req.cookies logs. Trace the request path between those entry points, then verify a concrete explanation for the empty object and confirm the expected accessToken value during validation.
Written by the indexing model from the issue text.
Description
working on node.js project where creating login and using cookies to store user. but for user validation to get current user. the token validation middleware is giving [Object: null prototype] {}
middle ware:
const vailedToken = asyncHandler(async(req, res, next)=>{
const token = req.cookies.accessToken;
console.log(token);
---stuff----
} );
});
module.exports = vailedToken;
and when i am testing as get route in app.js. the its showing the req.cookies with accessToken
app.get("/test", (req, res) => {
console.log("Cookies:", req.cookies);
res.json(req.cookies);
});
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 237
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from expressjs/cookie-parser
-
question
Difficulty 4/5 3-5 days Newbie friendliness 35/100
expressjs/cookie-parser#168 · 5 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
expressjs/cookie-parser#138 ·
-
perf: limit cookie parse only on some cookiePossibly taken @cesco69 claimed this 584 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 42/100
expressjs/cookie-parser#126 · 1 reaction ·
-
future question
Difficulty 5/5 Over a week Newbie friendliness 25/100
expressjs/cookie-parser#124 · 7 reactions ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 20/100
expressjs/cookie-parser#122 · 5 comments ·
All issues in expressjs/cookie-parser
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
OWASP/CheatSheetSeries#3018 ·
Maintainers usually reply within 1 day
-
Radix number block generates NaN after switching a negative or decimal number to binary, octal or hexPossibly taken @matthewalberto claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
mit-cml/appinventor-sources#4246 · 1 comment ·
Maintainers usually reply within 1 day
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
GoogleChrome/modern-web-guidance-src#3675 · 2 comments ·
Maintainers usually reply within 1 day