Forum: NGINX Cookie not created until refresh?

Posted by Broham (Guest)
on 2012-11-29 20:15
(Received via mailing list)
I have the following nginx conf file (shortened for the purose of this
question) that is creating a cookie:

    map $http_referer $setCookie {
            default "";
            ~*somewebsite\.com
"referrer=bl;Domain=.mysite.com;Max-Age=31536000";
    }

    server{

        listen 80;

        server_name mysite.com www.mysite.com dev.mysite.com;

        root /var/www/mysite.com;

        access_log /var/log/nginx/mysite.com.log spiegle;


        add_header Set-Cookie $setCookie;

        location  /{
                    #add_header Set-Cookie $setCookie;
        }
    }

The issue is that if I click on a link on `somewebsite.com` it navigates 
to
mysite, but does not create the cookie.  If I then refresh the page it 
will
create the cookie.  Why do I have to refresh to have the cookie created 
and
how can I get around this?

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,233395,233395#msg-233395
Posted by Andrey N. Oktyabrski (Guest)
on 2012-11-30 05:24
(Received via mailing list)
On 11/29/2012 11:14 PM, Broham wrote:

- ~*somewebsite\.com "referrer=bl;Domain=.mysite.com;Max-Age=31536000";
+ .somewebsite\.com "referrer=bl;Domain=.mysite.com;Max-Age=31536000";
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.