Forum Discussion
BASLI_amine_788
Nimbostratus
Aug 29, 2006How to use several pools and persistence profils with cookie insert method in an iRule
Hi,
We upgrade our Bigip from 4.2 to 9.2.3. In 4.2 the persistence was set on pools.So to keep our persistence in v9 we modified our irules to insert the right cookie depending on the pool we match. Exemple :
when HTTP_REQUEST {
if { [HTTP::host] matches_regex "^(www.)?cetelem.pt$"} {
redirect to "https://www.bancocetelem.pt"
}
elseif { [HTTP::host] matches_regex "^bancocetelem.pt$"} {
redirect to "https://www.bancocetelem.pt"
}
elseif { [HTTP::host] matches_regex "^www.bancocetelem.pt(:443)?$"} {
if { [HTTP::uri] starts_with "/PtDirect"} {
persist cookie insert Prf_cookie_Xnet-ptdirectnew
pool P_http_ptdirectnew
}
elseif { [HTTP::uri] starts_with "/PtHomeBK"} {
persist cookie insert Prf_cookie_Xnet_pthomebk
pool P_http_pthomebk
}
else {
persist cookie insert Prf_cookie_Xnet-ptdirect
pool P_http_ptdirect
}
}
}
In this example you can see the command we added to insert the cookie. In addition to bo able to do so we assigned a default persistance profil.
We encouter problems and the persistence doesn't work correctly. We lose connection and sometimes we are redirect to two differents members...
Can you please help us to configure correctly persistence using cookie insert method with iRules
Thank you
6 Replies
- unRuleY_95363Historic F5 AccountUh... I hate to correct, but no, the persist command doesn't reference the persist profile. Assuming he wants a cookie named "Prf_cookie_Xnet-ptdirectnew", then his persist cookie command syntax is correct.
- unRuleY_95363Historic F5 AccountI'm not sure which version you are running, but it really sounds like your are encountering a bug... It would probably be best to contact support.
- unRuleY_95363Historic F5 AccountNo problem Denny. We always appreciate all the help we can get!
- dennypayne
Employee
Resurrecting this thread....when HTTP_REQUEST { if { [HTTP::uri] contains "mema" } { persist cookie insert "Mema_Cookie" "0d 00:20:00" use pool GPC-test.p1 } elseif { [HTTP::uri] contains "gs1canada" } { persist cookie insert "GS1_Canada_Cookie" "0d 00:20:00" use pool GPC-test.p2 } else { persist cookie insert "Fallthrough_cookie" "0d 00:20:00" use pool GPC-test.p3 } }
- Ninjai_DI_67376
Nimbostratus
Is BIG-IP V9.2.3 required ? - Ninjai_DI_67376
Nimbostratus
It can be created in BIGIP V9.2.3.
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