Forum Discussion
GaryZ_31658
Sep 13, 2007Historic F5 Account
Persist on BIG-IP Session Cookie first else use use Server Cookie to select Pool
I am hoping to use a server cookie to select a pool based on matching data in the cookie. I would like to then use a BIG-IP Session Cookie to persist normally. Is there a better way to handle this? Wi...
Deb_Allen_18
Sep 14, 2007Historic F5 Account
I'd apply a cookie insert persistence profile to the virtual server, using the default cookie name [BIGipServer].
Then in your iRule, first look for an LTM persistence cookie and pick the pool based on the cookie name.
If no persistence cookie exists, then inspect the server-set cookie. If it contains a new_site_users class member, select the new_site_pool.
If neither condition is true, select the original_site_pool.
Class:
class new_site_users {
siteA
siteB
siteC
}Rule:when HTTP_REQUEST {
first look for LTM persistence cookie & extract pool name
set myPool [findstr [HTTP::cookie names] "BIGipServer" 11 " "]
if {$myPool != "" }{
pool $myPool
} elseif {[HTTP::cookie exists "server_set_cookie"] && \
[matchclass [HTTP::cookie "server_cookie"] contains $::new_site_users]}{
pool new_site_pool
} else {
pool original_site_pool
}
}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