add maxAge and overwrite options to ctx.cookies.set(name, value, [options]). (#743)
This commit is contained in:
parent
7396cae0ee
commit
fe620e140b
1 changed files with 2 additions and 0 deletions
|
@ -74,12 +74,14 @@ koa uses the [cookies](https://github.com/jed/cookies) module where options are
|
||||||
|
|
||||||
Set cookie `name` to `value` with `options`:
|
Set cookie `name` to `value` with `options`:
|
||||||
|
|
||||||
|
- `maxAge` a number representing the milliseconds from Date.now() for expiry
|
||||||
- `signed` sign the cookie value
|
- `signed` sign the cookie value
|
||||||
- `expires` a `Date` for cookie expiration
|
- `expires` a `Date` for cookie expiration
|
||||||
- `path` cookie path, `/'` by default
|
- `path` cookie path, `/'` by default
|
||||||
- `domain` cookie domain
|
- `domain` cookie domain
|
||||||
- `secure` secure cookie
|
- `secure` secure cookie
|
||||||
- `httpOnly` server-accessible cookie, __true__ by default
|
- `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.
|
koa uses the [cookies](https://github.com/jed/cookies) module where options are simply passed.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue