Forum Discussion
Chris1269_13050
Nimbostratus
Sep 29, 2015Issue with replacing Set Cookie path within iRule
We have an issue where we need to replace the path in a within Set-Cookie field. We use an iRule for the RESPONSE and it works as expected for the first one, but for subsiquent ones, its not applying...
Brad_Parker
Cirrus
Sep 29, 2015You could try something like this to iterate through the cookies present.
when HTTP_RESPONSE {
set cookies [HTTP::cookie names]
foreach cookie $cookies {
set cookie_value [HTTP::cookie $cookie]
set cookie_path [string map -nocase {"/OLD" "/NEW"} [HTTP::cookie path $cookie]]
HTTP::cookie remove $cookie
HTTP::cookie insert name $cookie value $cookie_value path $cookie_path
}
}
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
