We can get the original one working.
Can you add this to the bottom of your HTTP_RESPONSE event?
log local0. "cookie value set to [IP::remote_addr]"
Let's kill the encrypt/decrypt logic and make the rule look like this:
when HTTP_REQUEST {
If the cookie exists, connect to the IP specified in the cookie
if { [HTTP::cookie exists "cookie"] } {
if { ([HTTP::cookie "cookie"] ne "") } {
set persist_node [HTTP::cookie "cookie"]
foreach member [active_members -list [LB::server pool]] {
set node [lindex $member 0]
if { $node eq $persist_node } {
node $persist_node [lindex $member 1]
}
}
}
}
}
when LB_FAILED {
LB::reselect
}
when HTTP_RESPONSE {
HTTP::cookie insert name "cookie" value [IP::remote_addr] path /
Optionally comment out the above line and use the following line
instead while specifying a domain
HTTP::cookie insert name "cookie" value [IP::remote_addr] path / domain abc.com
}