From fe620e140bdec18efcaac31ca699378ad240632c Mon Sep 17 00:00:00 2001 From: Yu Qi Date: Thu, 26 May 2016 00:45:11 -0500 Subject: [PATCH] add maxAge and overwrite options to ctx.cookies.set(name, value, [options]). (#743) --- docs/api/context.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api/context.md b/docs/api/context.md index e267ffb..22b4c24 100644 --- a/docs/api/context.md +++ b/docs/api/context.md @@ -74,12 +74,14 @@ koa uses the [cookies](https://github.com/jed/cookies) module where options are Set cookie `name` to `value` with `options`: + - `maxAge` a number representing the milliseconds from Date.now() for expiry - `signed` sign the cookie value - `expires` a `Date` for cookie expiration - `path` cookie path, `/'` by default - `domain` cookie domain - `secure` secure cookie - `httpOnly` server-accessible cookie, __true__ by default + - `overwrite` a boolean indicating whether to overwrite previously set cookies of the same name (__false__ by default). If this is true, all cookies set during the same request with the same name (regardless of path or domain) are filtered out of the Set-Cookie header when setting this cookie koa uses the [cookies](https://github.com/jed/cookies) module where options are simply passed.