Forum Discussion
HTTP Domain Cookie not working on new 11.3 version
All, I upgraded our F5 LTM's from 9.x to 11.3. Had an existing irule to set cookie domain, but it doesn't seem to be working. Is my syntax correct for 11.3? I knew about changing the data groups by removing $:: Thanks, Bryce
when LB_SELECTED { get the pool name used for this request log local0. "my_pool is [LB::server pool]" set my_pool [LB::server pool] } when HTTP_RESPONSE {
Check if the persistence cookie exists in the response if {[HTTP::cookie exists "BIGipServer$my_pool"]} { set the domain attribute on the persistence cookie HTTP::cookie domain "BIGipServer$my_pool" ".foo.com" if {[HTTP::cookie exists "JSESSIONID"]} { HTTP::cookie domain "JSESSIONID" ".foo.com" } } }
2 Replies
- Kevin_Stewart
Employee
Your iRule is good. On a v11 system with partitions, the [LB::server pool] command will return the partition and pool.
/Common/local-poolYou just need to make a minor change:
when LB_SELECTED { get the pool name used for this request set my_pool [string map {"/Common/" ""} [LB::server pool]] log local0. "my_pool $my_pool" } when HTTP_RESPONSE { Check if the persistence cookie exists in the response if { [HTTP::cookie exists "BIGipServer$my_pool"] } { set the domain attribute on the persistence cookie HTTP::cookie domain "BIGipServer$my_pool" "foo.com" } if { [HTTP::cookie exists "JSESSIONID"] } { HTTP::cookie domain "JSESSIONID" "foo.com" } } - Bryce_Halkerst1
Nimbostratus
Kevin, Working perfectly now! Thanks for the quick response! Love this site. Bryce
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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