Skip to content
Myr

fix cookie max-age

Before adoption: this commit came in with the history the project adopted, so no landing records it.

the cookie module we depend on never used to set this value, however now it does :)

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent 1c616e2 · Browse files · 2 files+17 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+17 added−0 removed

  • tests:+16 added−0 removed
  • other:+1 added−0 removed

2 files+17 added−0 removed

modified:lib/response.js+1 added
576 unmodified lines
577 if ('object' == typeof val) val = 'j:' + JSON.stringify(val);578 if (signed) val = 's:' + sign(val, secret);579 if ('maxAge' in options) options.expires = new Date(Date.now() + options.maxAge);580 if (null == options.path) options.path = '/';581 options.maxAge /= 1000;582 this.set('Set-Cookie', cookie.serialize(name, String(val), options));583 return this;584};585
132 unmodified lines
modified:test/res.cookie.js+16 added