Welcome! Log In Create A New Profile

Advanced

set $cookie_abc "$cookie_abc";

February 11, 2013 04:49AM
I have some lua code where I play with the value of ngx.var.cookie_abc. The variable must exist if some assignment is done on it.

To achieve this I did

set $cookie_abc "$cookie_abc";

The above line clears the value of $cookie_abc, where in I assumed it to be defaulted if the value already exists.

i.e. if request has cookie abc="test" set, the $cookie_abc will have value test. But after executing the above expression the value is set to blank "". Where in it should have been "test". If the cookie value is not present in the request then obviously the value should be blank.

Is there a way around it? If not, can it be fixed.

Note even this won't work

set $tmp_abc "$cookie_abc";
set $cookie_abc "$tmp_abc";

There variable values are referential so even $tmp_abc become blank.

Regards
Amod
SubjectAuthorPosted

set $cookie_abc "$cookie_abc";

amodpandeyFebruary 11, 2013 04:49AM

Re: set $cookie_abc "$cookie_abc";

Ruslan ErmilovFebruary 11, 2013 05:14AM

Re: set $cookie_abc "$cookie_abc";

amodpandeyFebruary 11, 2013 08:41AM

Re: set $cookie_abc "$cookie_abc";

Valentin V. BartenevFebruary 11, 2013 11:06AM

Re: set $cookie_abc "$cookie_abc";

amodpandeyFebruary 11, 2013 01:07PM

Re: set $cookie_abc "$cookie_abc";

Valentin V. BartenevFebruary 11, 2013 01:18PM

Re: set $cookie_abc "$cookie_abc";

amodpandeyFebruary 11, 2013 01:21PM

Re: set $cookie_abc "$cookie_abc";

dbradfieldFebruary 11, 2013 01:54PM

Re: set $cookie_abc "$cookie_abc";

agentzhFebruary 11, 2013 02:48PM

Re: set $cookie_abc "$cookie_abc";

amodpandeyFebruary 11, 2013 10:21PM

Re: set $cookie_abc "$cookie_abc";

agentzhFebruary 12, 2013 02:58PM

Re: set $cookie_abc "$cookie_abc";

António P. P. AlmeidaFebruary 12, 2013 04:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 101
Record Number of Users: 5 on December 17, 2014
Record Number of Guests: 180 on December 21, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready