Chris_Miller
Apr 22, 2010Altostratus
iRule for Cookie Removal
I have 2 DCs fronted by a software GTM solution. When a user makes a request, GTM checks to see if they have a "DC" cookie. If they don't, it round robins the request. In the event that DC1 gets the request, the F5 there sets a cookie named "DC" with the value "1" and a server cookie for server-persistency. That way, GTM looks at the cookie and gets DC persistency.
If a DC goes bad, GTM will send the request to the other DC even though the cookie exists. So, the F5 at DC2 may see a cookie named "DC" with the value of "1". If that happens, I want the F5 at DC2 to remove the cookie.
Am I on the right track here?
when HTTP_REQUEST {
set strDC [HTTP::cookie "DC"]
if { $strDC equals "1"} {
HTTP::cookie remove "DC"
HTTP::cookie remove "server"
}
}