Nginx overwrite existing cookies with add_header

c0nw0nk nginx-forum at forum.nginx.org
Thu Aug 25 20:06:08 UTC 2016


I sorted out this problem now

Here was my soloution.

if ($host ~* www(.*)) {
set $host_without_www $1;
}
add_header Set-Cookie
"logged_in=1;Domain=$host_without_www;Path=/;Max-Age=315360000";

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,269189,269190#msg-269190



More information about the nginx mailing list