aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md96
1 files changed, 96 insertions, 0 deletions
diff --git a/README.md b/README.md
index e69de29..3fdae66 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,96 @@
+Name
+====
+
+lua-resty-cookie - This library parses HTTP Cookie header for Nginx and returns each field in the cookie.
+
+Table of Contents
+=================
+
+* [Name](#name)
+* [Status](#status)
+* [Synopsis](#synopsis)
+* [Installation](#installation)
+* [Authors](#authors)
+* [Copyright and License](#copyright-and-license)
+
+Status
+======
+
+This library is still experimental and under early development.
+
+Synopsis
+========
+
+ lua_package_path "/path/to/lua-resty-cookie/lib/?.lua;;";
+
+ server {
+ location /test {
+ local ck = require "resty.cookie"
+ local cookie, err = ck:new()
+ if not cookie then
+ ngx.log(ngx.ERR, err)
+ return
+ end
+
+ local field = cookie:get("lang")
+ ngx.say("lang", " => ", field)
+
+ local fields = cookie:get_all()
+
+ for k, v in pairs(fields) do
+ ngx.say(k, " => ", v)
+ end
+ }
+ }
+
+Installation
+============
+
+You need to compile [ngx_lua](https://github.com/chaoslawful/lua-nginx-module/tags) with your Nginx.
+
+You need to configure
+the [lua_package_path](https://github.com/chaoslawful/lua-nginx-module#lua_package_path) directive to
+add the path of your `lua-resty-cookie` source tree to ngx_lua's Lua module search path, as in
+
+ # nginx.conf
+ http {
+ lua_package_path "/path/to/lua-resty-cookie/lib/?.lua;;";
+ ...
+ }
+
+and then load the library in Lua:
+
+ local ck = require "resty.cookie"
+
+[Back to TOC](#table-of-contents)
+
+Authors
+=======
+
+Jiale Zhi <vipcalio@gmail.com>, CloudFlare Inc.
+
+Yichun Zhang (agentzh) <agentzh@gmail.com>, CloudFlare Inc.
+
+[Back to TOC](#table-of-contents)
+
+Copyright and License
+=====================
+
+This module is licensed under the BSD license.
+
+Copyright (C) 2013, by Jiale Zhi <vipcalio@gmail.com>, CloudFlare Inc.
+
+Copyright (C) 2013, by Yichun Zhang <agentzh@gmail.com>, CloudFlare Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+[Back to TOC](#table-of-contents)
+