Forum Discussion
hooleylist
Jun 25, 2009Cirrostratus
Persistence is specific to the pool. If the two pools you want to use have different members, then you would want to specify a different persistence cookie name depending on which pool to send the client to. So you could use 'persist cookie insert pool1_cookie 0' to insert a session cookie for pool 1 / use the existing cookie in the client's request to select the same pool1 member.
Here is some pseudo code to start with:
when HTTP_REQUEST {
Check if client has pool1 persistence cookie
if {[string length [HTTP::cookie value $pool1_persist_cookie_name]]}{
Client has pool1 persistence cookie. Check if pool is up?
Specify pool1 persistence to select same pool1 member
persist cookie insert $pool1_persist_cookie_name 0
Check if client has pool2 persistence cookie
} elseif {[string length [HTTP::cookie value $pool2_persist_cookie_name]]}{
Client has pool2 persistence cookie. Check if pool is up?
Specify pool2 persistence to select same pool2 member
persist cookie insert $pool2_persist_cookie_name 0
} else {
Client has no persistence cookie, so select between pool1 and pool2
Set persistence based on selected pool
}
}
Aaron