From 52f5f1f822499aed9229b3a4cd61f32f66a65f15 Mon Sep 17 00:00:00 2001 From: Maxim Ponomarev Date: Wed, 5 Nov 2014 23:20:10 +0500 Subject: fix README --- README.md | 23 ++++++++++++----------- 1 file 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. -- cgit v1.2.3-70-g09d2