add maxAge and overwrite options to ctx.cookies.set(name, value, [options]). (#742)

This commit is contained in:
Yu Qi 2016-05-26 00:31:11 -05:00 committed by Yiyu He
parent e61d54565b
commit b16d24ecb8
1 changed files with 2 additions and 0 deletions

View File

@ -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.