diff options
author | Jiale Zhi <vipcalio@gmail.com> | 2014-11-05 11:28:35 -0800 |
---|---|---|
committer | Jiale Zhi <vipcalio@gmail.com> | 2014-11-05 11:28:35 -0800 |
commit | c15c39976c7f92ae307b4c49fadeee6acac8a7b3 (patch) | |
tree | 94c9746221b60c9c7916f14ba4e2dc367f3aa60e | |
parent | 0c8c5a69cfe34449d8fdbabb4089a1bc699be67b (diff) | |
parent | 52f5f1f822499aed9229b3a4cd61f32f66a65f15 (diff) | |
download | lua-resty-cookie-c15c39976c7f92ae307b4c49fadeee6acac8a7b3.tar.gz lua-resty-cookie-c15c39976c7f92ae307b4c49fadeee6acac8a7b3.tar.bz2 lua-resty-cookie-c15c39976c7f92ae307b4c49fadeee6acac8a7b3.zip |
Merge pull request #4 from maxvipon/master
fix README
-rw-r--r-- | README.md | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -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. |