Express 5.3.0 res.cookie output: 'c=d; Max-Age=1; Path=/; Expires=...; HttpOnly; Secure; SameSite=Lax'; default is only 'a=b; Path=/'
@btw-aak▲ 5 net votes
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'.