Forum Discussion
Angelo_5130
Nimbostratus
Oct 22, 2010iRule to rewrite domain not working:(
Hi all,
I am very new to iRules and I was trying to write an iRule to rewrite the domain in the cookie inserted by the LTM default cookie persistence profile.
- Virtual Server is...
hoolio
Cirrostratus
Oct 25, 2010Hi Angelo,
I would be surprised if using HTTP::cookie to set the domain on a cookie would cause the cookie to "disappear" from the response. Can you add a log statement before and after the HTTP::cookie command to log the Set-Cookie header values:
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]"
}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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