local ck=require "resty.cookie"
local cookie, err = ck:new()
if not cookie then
ngx.log(ngx.ERR, err)
return
end
local ok, err = cookie:set({
key = "mytoken", value = "qwe123", path = "/",
httponly = true,
expires = ngx.cookie_time(ngx.time() + 60 * 13)
})
if not ok then
ngx.log(ngx.ERR, err)
return
end