Hello,
I just migrated Apache to nginx, there is a rewrite rule to set cookie based on query string. If query string contains a parameter f=foo,then set Cookie (Key=f,Value=foo), and expire at two months later.
I use :
location / {
if($query_string ~ "([^&]*)f=([^&]*)"){ #check whether there has a 'f=xx' key/value pairs.
add_header Set-Cookie "f=$2; path=/; domain=bar.com";
}
it worked but how to set cookie expire time? It is a variable = $current_time + 60d
Best Regards.
baoming sun
Edited 1 time(s). Last edit at 09/09/2009 10:33AM by sunbaoming.