Forum Discussion
Aaron_33366
Mar 14, 2011Nimbostratus
Wildcard cookie
Hello. I have migrated my config from a Cisco CSS to an F5 LTM and have run into a problem. One the CSS I was able to have a cookie that was use for all parts of the domain. I was able to set the o...
hooleylist
Mar 15, 2011Cirrostratus
You can set the domain on the persistence cookie that LTM sets from the cookie insert persistence profile. You don't need to set or modify the cookie value.
when HTTP_RESPONSE {
log local0. "[IP::client_addr]:[TCP::client_port]: Pre Set-Cookies: [HTTP::header values Set-Cookie]"
Check if the persistence cookie exists in the response
if {[HTTP::cookie exists "My_cookie"]} {
set the domain attribute on the persistence cookie
HTTP::cookie domain "My_cookie" ".mydomain.com"
log local0. "[IP::client_addr]:[TCP::client_port]: Modified domain on My_cookie"
}
log local0. "[IP::client_addr]:[TCP::client_port]: Post Set-Cookies: [HTTP::header values Set-Cookie]"
}
If you want to use the same iRule on multiple virtual servers with different pools and corresponding persistence default cookie names, you could add logic to the iRule to look for a cookie name based on BIGipServer[LB::server name].
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects