Here is the final working irule, until the customer asks me to change it agiain : )
when HTTP_REQUEST {
search cookies in http header for a bigip issued cookie
set CookiePool [findstr [HTTP::cookie names] "BIGipServer" 11 " "]
if bigip cookie is present AND pool it points at is active, then go to pool...maintians user shopping cart info. Log to local0.
if { $CookiePool !=""} {
if {[active_members $CookiePool] > 0} {
pool $CookiePool
log local0. "sending [IP::client_addr] coming in on [IP::local_addr] to pool $CookiePool" }
else {
if original pool is down, use the default pool for the new VS...send the 302 to the user to expire out the cookie from the
original pool so that that the only cookie present is for the new pool. User will lose shopping cart from original pool.
log client ip, VS IP, and pool info to local0. for troubleshooting.
pool [LB::server pool]
HTTP::respond 302 Location "http://[HTTP::host]" "Set-Cookie" "BIGipServer$CookiePool=; path=/; Max-Age=0;"
log local0. "removing cookie BIGipServer$CookiePool. Remaining cookies are [HTTP::cookie names]"
log local0. "sending [IP::client_addr] coming in on [IP::local_addr] to pool [LB::server pool] because original pool $CookiePool is down"
}
}
else {
if no bigip cookie is present - ie new session, then use the default pool for the VS.
pool [LB::server pool]
}
}