Forum Discussion
v10 cookie insert problem
I have some logic that checks for the existence of a cookie and if it's missing, add one with a value.
When I add the cookie however, I get a comma then a plus then a semi-colon then my cookie=value.
My problem is...the comma.
Why is it showing up?
How do I get rid of it?
set frameworkCookie "T1Domain=T1Thick"
HTTP::cookie insert name "TF_Framework_Cookies" value $frameworkCookie
This gives me the following (TFSessionId is another cookie that exists already)
TFSessionId=Z1NBCMSse/6Cm5P5w5eaGnxgtaCFRAhr05x5fp6Tt07GQOYozs3rI1tgDKooBNYzcZ00JqwOLeJvJazGXTZdTrQRLg8b4wzFO+TfzsH5+ya9ak6oD8c3He4F2JD5EKFFp4r9M2agbxcSNsg11J2ilaRPM3Wrz0BdNYE8xCZ049awciTWc771SdX+wdyly6BG9Nxo0rCu16xDG3ztnAYB+Ipp69CP6E+311y3o6JUSrM=,+;TF_Framework_Cookies=T1Domain=T1Thick;
Why does HTTP::cookie insert stick a comma on the end of the existing cookies before appending my new one?
Yes, the existing cookie value has an equals sign. When I don't add my cookie, the existing cookie does not have a trailing comma. When the ASP.NET_SessionID is added on some requests, there still is no comma...onluy when I add a cookie with my iRule.
Ideas?
- hoolio
Cirrostratus
Hi Jason, - Jason_Hook_4092
Nimbostratus
We are running 10.0.1 build 283.0 - hoolio
Cirrostratus
Where are you actually seeing the corrupted cookies? Is this on the server in the logs? If so, could you confirm this is what LTM sends by running a tcpdump on LTM?when HTTP_REQUEST { HTTP::cookie insert name rule_cookie1 value rule=value=1 log local0. "\[HTTP::cookie value rule_cookie1\]: [HTTP::cookie value rule_cookie1]" log local0. "\[HTTP::header values Cookie\]: [HTTP::header values Cookie]" log local0. "\[HTTP::header value Cookie\]: [HTTP::header value Cookie]" }
0x00c0 743a 202a 2f2a 0d0a 436f 6f6b 6965 3a20 t:.*/*..Cookie:. 0x00d0 636c 6965 6e74 5f73 656e 743d 636c 6965 client_sent=clie 0x00e0 6e74 5f76 616c 7565 0d0a 436f 6f6b 6965 nt_value..Cookie 0x00f0 3a20 7275 6c65 5f63 6f6f 6b69 6531 3d72 :.rule_cookie1=r 0x0100 756c 653d 7661 6c75 653d 313b 0d0a 0d0a ule=value=1;....
- Jason_Hook_4092
Nimbostratus
This is what I see on the wire to the web server coming from LTM:GET /HPOEWB.WEB/HPOEWBTestPage.aspx?tfThomletId=3761 HTTP/1.1
HTTP::cookie insert name value [path ] [domain ] [version <0 | 1 | 2>]
- hoolio
Cirrostratus
Multiple cookie headers are valid in an HTTP request and you can have multiple Set-Cookie headers in a response. - Jason_Hook_4092
Nimbostratus
I guess I've never seen more than one Cookie header. - hoolio
Cirrostratus
Not sure about the authority of the site, but this one says: - mattwerth_21881
Nimbostratus
I am having the same problems. F5 cookie insert is doing things that IIS doesnt like. Its adding commas between new cookies, as described above. More specifically, it looks like F5 is adding a second Cookie header, which IIS is incorrectly trying to append them and shows the comma. In my case this is inadvertently trashing the ASPSESSIONID which breaks my app.
I would think the F5 should correct this and insert the new cookie to the end of the list of cookies in the existing Cookie header.
- sfuerst_116779Historic F5 AccountIn 11.x and earlier, the BigIP will add a new cookie header when inserting a cookie. In 12.x and beyond, the BigIP will try to append the new cookie to a cookie header if able. Since there are multiple different cookie RFC's, and hence versions of the cookie header, the BigIP may not always be able to append. If not, it will fall back to 11.x behavior and insert a new cookie header of the requested RFC version. The default in 12.x is to use RFC 6265 style cookies.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com