In Express.js, req.cookies is an object of cookie name/value pairs from the request Cookie header. With the cookie-parser middleware mounted, a header like Cookie: name=tj becomes req.cookies.name === 'tj'.
If the client sends no cookies, it defaults to {}. Signed cookies belong in req.signedCookies instead. This is a server-side property on the request object.
Syntax
Read req.cookies in your Express.js route handler. Start with this line.
GET /login
→ Set-Cookie: userId=s%3A42.<signature>; …
GET /dashboard (valid signed cookie)
→ Welcome user 42
GET /dashboard (tampered / missing)
→ 401 Unauthorized
(req.signedCookies.userId is false or undefined)
How It Works
Share a secret.cookieParser('my-secret-key') enables signing and verification.
Set with signed: true. The cookie value is prefixed and signed; it lands in req.signedCookies later.
Read signed values only. Do not trust req.cookies.userId for this ID — that channel is easy to spoof.
Treat false as failure. A bad signature becomes false; missing cookies are undefined. Both mean “not authorized.”
Compatibility
Runtime Support
req.cookies is an Express.js request property filled by cookie-parser on the server. It runs on Node.js (Express 5 needs Node.js 18+). Browsers only send the Cookie header.
✓ Server · Express 4 & 5
req.cookies
Works wherever Express runs: Node.js is the primary target. Bun and Deno can run many Express apps with compatibility layers. Not available in the browser.
ServerNode.js runtime API
Node.js18+ for Express 5 · 14+ typical for Express 4
Supported
BunExpress-compatible server apps
Supported
DenoVia npm compatibility / adapters
Supported
req.cookiesExpress on Node.js
Bottom line: Install cookie-parser, mount it with app.use, then read req.cookies in your routes.
Frequently Asked Questions
It is an object of cookie name/value pairs from the request Cookie header. cookie-parser middleware fills it; with no cookies it defaults to {}.
Yes. Install and mount cookie-parser with app.use(cookieParser()) before your routes. Express does not parse cookies by itself.
req.cookies holds unsigned cookies. Signed cookies are moved to req.signedCookies after the secret validates them, so spoofed values are easier to spot.
No. Signing only detects tampering. The value is still readable by the client — never put secrets in cookie values.
No. Clients can forge Cookie headers. Validate values, and use signed cookies when integrity matters.