I have at condition checking to see if user has a cookie like this:
if ($http_cookie ~* "developer=true" ) {
...
}
I'm not familiar with the ~* syntax, I assume that that means if it 'contains', but what about the opposite? like what if I wanted to check if $http_cookie doesn't contain that cookie?
From stackoverflow
-
You can test the variable does not match a regex using
!~(case sensitive) and!~*(case-insensitive) operators:if ($http_cookie !~* "developer=true") { }By the way, if you want to test a value of cookie named "developer", it would be probably more clear to say:
if ($cookie_developer = "true") { }
0 comments:
Post a Comment