Setting cookies in nginx

Setting a cookie in nginx is easy. Look at the following example of setting the cookie lcid with the value 1033 when a page url starts with "/fr/":
location ~* (^/fr/) {
     add_header Set-Cookie lcid=1033;
     # ... do additional nginx config stuff here
}
It's harder to find examples of how to set a cookie in nginx with domain, path, expires or max-age information. The following code worked with nginx 0.7.67. While you can specify Expires, the Max-Age argument works better in the context of nginx where I could not find a reliable way to specify a date in the future without hard-coding it. Max-Age is seconds from now and gets converted to Expires by your browser.
location ~* (^/fr/) {
     add_header Set-Cookie "lcid=1033;Domain=.ebrueggeman.com;Path=/;Max-Age=31536000";
     # ... do additional nginx config stuff here
}