Welcome! Log In Create A New Profile

Advanced

Cookie not created until refresh?

November 29, 2012 02:14PM
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?
SubjectAuthorPosted

Cookie not created until refresh?

BrohamNovember 29, 2012 02:14PM

Re: Cookie not created until refresh?

Andrey N. OktyabrskiNovember 29, 2012 11:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 74
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 184 on July 08, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready