get cookie value which name contains hyphen

Maxim Dounin mdounin at mdounin.ru
Wed Dec 20 13:12:43 UTC 2017


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/


More information about the nginx mailing list