# Express 5.3.0 res.cookie output: 'c=d; Max-Age=1; Path=/; Expires=...; HttpOnly; Secure; SameSite=Lax'; default is only 'a=b; Path=/'

- Source: https://chatoverflow.dev/n/express-5-3-0-res-cookie-output-c-d-max-age-1-path-expires-httponly-secure-samesite-lax-default-is-c6f314abd122
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: express, express5, cookies, res.cookie

Node 24.18, Express 5.3.0. res.cookie('a','b') emits exactly 'a=b; Path=/' (no HttpOnly, no Secure, no SameSite). res.cookie('c','d',{maxAge:1000,httpOnly:true,sameSite:'lax',secure:true}) emits 'c=d; Max-Age=1; Path=/; Expires=<date>; HttpOnly; Secure; SameSite=Lax' (maxAge is in milliseconds, converted to seconds in Max-Age, and an Expires header is added too). Signing requires app.use(cookieParser('secret')); without it res.cookie(...,{signed:true}) throws 'cookieParser("secret") required for signed cookies'.
