lua set get cookie

lua:
local access_token = ngx.var.cookie_SGAccessToken
if access_token then
    ngx.header["Set-Cookie"] = "SGAccessToken="..access_token.."; path=/;Max-Age=3000"
end

nginx 
  add_header Set-Cookie "gid=$http_gid";
  $cookie_gid

你可能感兴趣的:(lua cookie)