From b16d24ecb83b403e26f9c4f9c5f67023fbdeb6f7 Mon Sep 17 00:00:00 2001 From: Yu Qi Date: Thu, 26 May 2016 00:31:11 -0500 Subject: [PATCH] add maxAge and overwrite options to ctx.cookies.set(name, value, [options]). (#742) --- docs/api/context.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api/context.md b/docs/api/context.md index 045211f..d9dd193 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.