Forum Discussion
Migration tomorrow from v9 to v11.. worried about cookies
Hello,
I am doing a migration from an older version (v9) to a new one (v11) shortly am and curious as to whether or not this iRule will work from v9. It took on the unit itself, and there are probably better ways to do it now.. but for times sake, wanted to verify.. Thanks
iRule is:
when HTTP_RESPONSE { if { [HTTP::host] == "xyz.xyz.com" } { pool xyz } elseif { [HTTP::host] == "xyz.blah.com" } { pool blah } foreach cookie [HTTP::cookie names] { set value [HTTP::cookie value $cookie];
if { $value != "" && $cookie != "abc" && $cookie != "abcd" && $cookie != "abcde" && $cookie != "abcdef" } {
set testvalue [string tolower $value]
set valuelen [string length $value]
set value "$value; HttpOnly";
if { [string length $value] > $valuelen} {
HTTP::cookie value $cookie "${value}"
}
}
}
1 Reply
- samstep
Cirrocumulus
It should work - there is nothing v11-incompatible there.
in V11 this irule can be simplified as starting from v11 HTTP::cookie command supports addition of "httponly attribute", see HTTP::cookie documentation here:
https://devcentral.f5.com/wiki/iRules.HTTP__cookie.ashx
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