Skip to content

Releases: chandu-atina/lua-resty-cookie

Lua-resty-cookie with get_all_as_list method

30 Nov 16:07
3af537c
Compare
Choose a tag to compare

Added new method get_all_as_list to retrieve cookies as a lua table list of cookies from HTTP request including multiple cookies with same name.

An HTTP request can have multiple cookies with same name when they have different PATH or different DOMAIN(a sub domain). For e.g. Cookies created by example.com domain will be accessible to test.example.com

Cookie #1 : name="SAMPLE", value="ABC", path ="/", domain="example.com"
Cookie #2 : name="SAMPLE", value="XYZ", path ="/account", domain="example.com"

Cookie #1 : name="SAMPLE", value="ABC", path ="/", domain="test.example.com"
Cookie #2 : name="SAMPLE", value="XYZ", path ="/", domain="example.com" 

The existing get_all will override the previous cookie value with the latest value when we have multiple cookies with same name.