Welcome! Log In Create A New Profile

Advanced

Re: set cookie if not already set

Valentin V. Bartenev
December 13, 2012 06:36PM
On Thursday 13 December 2012 22:29:07 amodpandey wrote:
> I figured out a simple solution so thought to share it ( to get feedback or
> may be to help ). In an earlier discussion I got to know about map and why
> one should avoid to use if an try to use map.
>
> http {
>
> map $cookie_abt $abt {
> default "abt=a;Path=/";
> ~.+$ "";
> }
>
[...]

This one:

map $cookie_abt $abt {
default "";
"" "abt=a;Path=/";
}

does the same thing, but without the resource consuming regular expression.
Moreover, it looks plain and more readable.

wbr, Valentin V. Bartenev

--
http://nginx.com/support.html
http://nginx.org/en/donation.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

set cookie if not already set

amodpandey December 13, 2012 01:29PM

Re: set cookie if not already set

Valentin V. Bartenev December 13, 2012 06:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 311
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready