add cookie docs
This commit is contained in:
parent
3c3b81b960
commit
a9ae563051
1 changed files with 17 additions and 0 deletions
17
docs/api.md
17
docs/api.md
|
@ -528,6 +528,23 @@ switch (this.accepts('json', 'html', 'text')) {
|
||||||
Check if a response header has already been sent. Useful for seeing
|
Check if a response header has already been sent. Useful for seeing
|
||||||
if the client may be notified on error.
|
if the client may be notified on error.
|
||||||
|
|
||||||
|
### ctx.cookies.get(name, [options])
|
||||||
|
|
||||||
|
Get cookie `name` with `options`:
|
||||||
|
|
||||||
|
- `signed` the cookie requested should be signed
|
||||||
|
|
||||||
|
### ctx.cookies.set(name, value, [options])
|
||||||
|
|
||||||
|
Set cookie `name` to `value` with `options`:
|
||||||
|
|
||||||
|
- `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
|
||||||
|
|
||||||
### ctx.socket
|
### ctx.socket
|
||||||
|
|
||||||
Request socket object.
|
Request socket object.
|
||||||
|
|
Loading…
Reference in a new issue