Forum Discussion

Robert_47833's avatar
Robert_47833
Icon for Altostratus rankAltostratus
Aug 17, 2011

HTTP::cookie insert name 1cookie value 2 path "/" domain $domain

Hi,dear irule

 

when HTTP::request

 

{set domain [domain [HTTP::host] 2]}

 

 

when HTTP::response

 

{

 

HTTP::cookie insert name 1_cookie value "2" path "/" domain $domain

 

 

}

 

 

with this irule,we suppose hostname is www.srwd18.com

 

I send request to VIP

 

and the situation is:

 

first :broswer received cookie 1_cookie from bigip and domain is "www.srwd18.com"(why isn't is srwd18.com)

 

second:I continue to open page in broswer,it send this 1_cookie to vip now with domain ".srwd18.com"

 

 

why?

 

I am confused

 

I check this via http fox on firefox

 

9 Replies

  • Hi Jucao,

     

     

    The domain on cookies should start with a leading period. Can you change this line and retest:

     

     

    set domain ".[domain [HTTP::host] 2]"

     

     

    Aaron
  • Hi,thanks,Aaron

     

    even I change it to .[domain [HTTP::host]2]

     

    the phenomenon is the same as before

     

     

    receive cookie with domain www.srwd18.com

     

    then send cookie with domain .srwd18.com

     

     

  • Just some basic checks, clear browser cookies between tests or it will re-present a cookie from before. In the incoming response from the F5 is it presenting one 1_cookie or two. If you have a persistence profile assigned to the VIP you may be doubling up on cookies.

     

     

    Kevin (Jarvil)

     

  • Hi,Kevin

     

    I have cleared the cookie

     

    it is the same ,no persistence profile
  • Can you try testing with curl on LTM to see if the cookie is being set correctly? You can use something like this:

     

     

    curl -v http://1.1.1.1/file.ext -H "Host: www.example.com"

     

     

    You can check the Set-Cookie header in the response to see if the cookie is being set. If that works, then I'd try opening a case with F5 Support and ask them to review your HttpFox logs.

     

     

    Aaron
  • Hi,Aaron

     

    BTW:can you tell me how to check cookie which is send via curl command

     

     

    I want to check if I receive "< Set-Cookie: BigipABurl_cookie=2;path=/;domain=srwd18.com;",which cookie will be sent(this cookie is session based)

     

    yes,via curl,if I set domain ".[domain [HTTP::host] 2]",it will receive "< Set-Cookie: BigipABurl_cookie=2;path=/;domain=.srwd18.com;"

     

    if I set domain "[domain [HTTP::host] 2]" ,it will receive "< Set-Cookie: BigipABurl_cookie=2;path=/;domain=srwd18.com;"

     

    it seems there are some problem in http fox
  • I want to know whether it affect the cookie which is sent,if both of them are" .srwd18.com",it is ok
  • OK,the problem is when you check cookie tab on http fox of Firefox,you will see www.srwd18.com,but in the“header” tab,it is still "srwd18.com " or ".srwd18.com"

     

    I want to know whether "srwd18.com" affect the fuction of this cookie,it seems it can send this cookie to xxx.srwd18.com