if ($host ~* www(.*)) {
set $host_without_www $1;
}
header_filter_by_lua '
ngx.header["Set-Cookie"] = "value=1; path=/; domain=" .. ngx.var.host_without_www .. "; expires=" .. ngx.cookie_time(ngx.time()+2592000) .. "; Max-Age=2592000" -- +1 month 30 days
';--
You received this message because you are subscribed to the Google Groups "openresty-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openresty-en...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
ngx.time()+2592000
To be used inside thisif ($host ~* www(.*)) {
set $host_without_www $1;
}
add_header Set-Cookie "value=1;domain=$host_without_www;path=/;expires="LUA VALUE HERE";Max-Age=2592000";
if ($host ~* www(.*)) {
set $host_without_www $1;
}set_by_lua $expires_time 'return ngx.cookie_time(ngx.time()+2592000)';
add_header Set-Cookie "value=1;domain=$host_without_www;path=/;expires=$expires_time;Max-Age=2592000";