get cookie value which name contains hyphen

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

get cookie value which name contains hyphen

sonpg
my app set a cookie which named like SESSIONID-MYAPP, i want to write the
value of that cookie to log file, but i tried $cookie_SESSIONID_MYAPP,
$cookie_SESSIONID-MYAPP, but i can't get what i want.

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

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: get cookie value which name contains hyphen

Maxim Dounin
Hello!

On Wed, Dec 20, 2017 at 05:01:35AM -0500, foxgab wrote:

> my app set a cookie which named like SESSIONID-MYAPP, i want to write the
> value of that cookie to log file, but i tried $cookie_SESSIONID_MYAPP,
> $cookie_SESSIONID-MYAPP, but i can't get what i want.

You wan't be able to access cookies with characters like '-' in
their names using the $cookie_* variables.  Instead, consider
using the $http_cookie variable and extracting a particular cookie
yourself.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx