Forum Discussion
cookie not getting set using HTTP::cookie
I have a rule that is setting a cookie in an HTTP_REQUEST event before handing the request to the server. This is working on my development unit but the cookie fails to set on my production unit.
There are a couple of differences between development and production. Development is a BigIP 1500 running 9.4.7. Production is a BigIP 1600 9.4.8.
Here is what my rule is doing:
when HTTP_REQUEST {
if { not ( [HTTP::cookie language] equals $user_selected_language ) } {
HTTP::cookie language $user_selected_language
HTTP::cookie update_language 1
}
}
Again, this is working on 9.4.7 but fails to set the cookie "language" on 9.4.8. I have added logging lines to my rule and have verified that the $user_selected_language has some value in every case (so I left that part of the rule out). I tried checking for the existence of the cookie and doing an HTTP::cookie insert name "language" value "$user_selected_language" if the cookie didn't exists. That didn't do anything. If it is any help, the cookie doesn't exist.
I read through the 9.4.8 release notes and found something about a trailing semicolon getting inserted by the HTTP::cookie insert command. I didn't think that was happening in my case but I tried the workaround detailed in the release notes but that didn't help.
Any ideas? Any ideas of what to try next?
Richard
- richard_77048
Nimbostratus
Well, I got my problem solved. I may go back to my original approach just because it does a little less processing but that is a project for another day. - hoolio
Cirrostratus
The iRule you posted was using HTTP_REQUEST. So you were inserting cookies in the requests proxied to the pool members--not the response. Paths, domains and other cookie attributes are only included when the cookie is set in replies back to the client. These properties dictate how and when the server would like the client to send the 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