Forum Discussion

madi_56757's avatar
madi_56757
Icon for Nimbostratus rankNimbostratus
Mar 19, 2007

HTTP::cokkie

Hello all,

 

 

a short question regarding the HTTP:cookie implementation!

 

I have done a lot of tests for this topic, but it's seems not to work as I understood!

 

So my question: I have a LTM with 9.1.1

 

I tried followed sysntax:

 

 

------------------------------------

 

when HTTP_REQUEST {

 

set isset [HTTP::cookie exists abc]

 

log local0. $isset

 

}

 

---------------------------------

 

I'm sure the cookie abc is exist, but the $isset anytime 0

 

 

later I tried to set the cookie, but the command HTTP::cookie insert name abc is not working

 

---------------------------------

 

when HTTP_REQUEST {

 

set isset [HTTP::cookie exists abc]

 

log local0. $isset

 

}

 

when HTTP_RESPONSE {

 

if {$isset == 0} {

 

HTTP::cookie insert name abc

 

}

 

}

 

----------------------------------

 

this is the error

 

01070151:3: Rule [forwarding_excentive] error:

 

line 7: [wrong args] [HTTP::cookie insert name abc]

 

----------------------------------

 

the question: is the syntax HTTP::cookie implemented completely in 9.1.1?

 

I have read the release notes but I could find nothing to this!

 

 

can anybody help me?

 

Thanks

 

Markus

1 Reply

  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Hi Markus --

    The cookie commands are case sensitive -- could it be that your cookie is actually named ABC? Try this HTTP_REQUEST event to really see what the iRule sees:
    when HTTP_REQUEST {
      set isset [HTTP::cookie exists abc]
      log local0. "isset=$isset"
      foreach cookie [HTTP::cookie names] {
        log local0. "Cookie: $cookie=[HTTP::cookie $cookie]"
      }
    }

    As for the insert error, I believe you are missing the value of the cookie -- try this instead:
    HTTP::cookie insert name abc value 123
    HTH

    /deb