Welcome! Log In Create A New Profile

Advanced

How to check the existence of a http-only secure cookie

February 20, 2013 05:10PM
I have a http-only and secure (ssl) cookie, and I want nginx to check whether this cookie exists in a request, if not, reject it by serving a 404 page. This is just a preliminary check, so I don't care about the actual value in the cookie.

So far I've tried this: if ($http_cookie !~* "cookie_name=[.]+") { return 404; } in a location directive, but despite the cookie is contained in the requests, 404 is returned. What should be corrected here? Thanks!
SubjectAuthorPosted

How to check the existence of a http-only secure cookie

mrtnFebruary 20, 2013 05:10PM

Re: How to check the existence of a http-only secure cookie

Francis DalyFebruary 20, 2013 05:24PM

Re: How to check the existence of a http-only secure cookie

mrtnFebruary 21, 2013 08:27AM

Re: How to check the existence of a http-only secure cookie

Valentin V. BartenevFebruary 21, 2013 08:42AM

Re: How to check the existence of a http-only secure cookie

kalpesh.patel@glgroup.comMarch 11, 2013 05:54PM

Re: How to check the existence of a http-only secure cookie

Valentin V. BartenevMarch 12, 2013 03:02AM

Re: How to check the existence of a http-only secure cookie

kalpesh.patel@glgroup.comMarch 12, 2013 01:38PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 75
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready