header_filter_by_lua ‘
t = {}
if ngx.var.http_cookie then
s = ngx.var.http_cookie
for k, v in string.gmatch(s, "(%w+)=([%w%/%.=_-]+)") do
t[k] = v
end
end
p = ngx.req.get_uri_args()
if not t.uid and p.uid then
expires = ngx.cookie_time(4523969511)
ngx.header["Set-Cookie"] = {"uid=" .. p.uid .."; expires=" .. expires .. ";
end
‘;
时间: 2024-11-11 04:00:12