Cliff, thanks for this, but wouldn't that redirect the page before setting the cookie? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,204130,204158#msg-204158