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!
Subject Author Posted

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

mrtn February 20, 2013 05:10PM

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

Francis Daly February 20, 2013 05:24PM

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

mrtn February 21, 2013 08:27AM

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

Valentin V. Bartenev February 21, 2013 08:42AM

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

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

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

Valentin V. Bartenev March 12, 2013 03:02AM

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

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



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 60
Record Number of Users: 6 on August 08, 2016
Record Number of Guests: 386 on August 02, 2016
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready