rule to check cookie value

Mar 12, 2010 at 2:44 AM

 

Hi. I can't get this to work. What value in the cookie is the rule looking for? In my case, the cookie is storing a UserID value (integer). No matter what I try, the following rule always evaluates true (as seen in the iirf log):
RewriteCond %{HTTP_COOKIE}         (?!UserID.+)              [I]
The actual contents of the cookie are:
 
UserID
%2D1
cas.lablynx.com/
1024
3727591424
30065056
2823749136
30064959
*
UserID
%2D1
mydomain.com/
1024
3727591424
30065056
2823749136
30064959
*
Thanks for any help!!
Hi. I can't get this to work. What value in the cookie is the rule looking for? In my case, the cookie is storing a UserID value (integer). No matter what I try, the following rule always evaluates true (as seen in the iirf log):
RewriteCond %{HTTP_COOKIE}         (?!UserID.+)              [I]
The actual contents of the cookie are:
UserID
%2D1
cas.lablynx.com/
1024
3727591424
30065056
2823749136
30064959
*
UserID
%2D1
mydomain.com/
1024
3727591424
30065056
2823749136
30064959
*
Thanks for any help!!

 

Coordinator
Mar 12, 2010 at 3:17 AM

Hi,

a cookie is a string.  I don't understand what you mean by offering that long list. what is the value of the cookie as shown in Fiddler, for example? It should be a string, all on one line.

If you want the condition to be true when the string "UserID" is not in the cookie, try

RewriteCond %{HTTP_COOKIE}         !UserID.+