aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Ponomarev <maxvipon@gmail.com>2014-11-05 23:20:10 +0500
committerMaxim Ponomarev <maxvipon@gmail.com>2014-11-05 23:20:10 +0500
commit52f5f1f822499aed9229b3a4cd61f32f66a65f15 (patch)
tree94c9746221b60c9c7916f14ba4e2dc367f3aa60e
parent0c8c5a69cfe34449d8fdbabb4089a1bc699be67b (diff)
downloadlua-resty-cookie-52f5f1f822499aed9229b3a4cd61f32f66a65f15.tar.gz
lua-resty-cookie-52f5f1f822499aed9229b3a4cd61f32f66a65f15.tar.bz2
lua-resty-cookie-52f5f1f822499aed9229b3a4cd61f32f66a65f15.zip
fix README
-rw-r--r--README.md23
1 files changed, 12 insertions, 11 deletions
diff --git a/README.md b/README.md
index a6e76aa..84da1ed 100644
--- a/README.md
+++ b/README.md
@@ -102,7 +102,7 @@ Get a single client cookie value. On error, returns `nil` and an error message.
get_all
-------
-`syntax: fields = cookie_obj:get_all()
+`syntax: fields, err = cookie_obj:get_all()`
Get all client cookie key/value pairs in a lua table. On error, returns `nil` and an error message.
@@ -110,17 +110,18 @@ Get all client cookie key/value pairs in a lua table. On error, returns `nil` an
set
---
-`syntax: ok = cookie_obj:set({
- key = "Name",
- value = "Bob",
- path = "/",
- domain = "example.com",
- secure = true, httponly = true,
- expires = "Wed, 09 Jun 2021 10:18:14 GMT",
- max_age = 50,
- extension = "a4334aebaec"
+```lua
+syntax: ok, err = cookie_obj:set({
+ key = "Name",
+ value = "Bob",
+ path = "/",
+ domain = "example.com",
+ secure = true, httponly = true,
+ expires = "Wed, 09 Jun 2021 10:18:14 GMT",
+ max_age = 50,
+ extension = "a4334aebaec"
})
-`
+```
Set a cookie to client. This will add a new 'Set-Cookie' response header. `key` and `value` are required, all other fields are optional.
If the same cookie (whole cookie string, e.g. "Name=Bob; Expires=Wed, 09 Jun 2021 10:18:14 GMT; Max-Age=50; Domain=example.com; Path=/; Secure; HttpOnly;") has already been setted, new cookie will be ignored.