Forum Discussion
Mike_73765
Nimbostratus
Aug 20, 2010issue with cookie persist irule
Hey guys, I am having an issue with an irule that I got from code share that is shown below. This irule is used on 2 virtual servers (using the same nodes, but different ports) and should be persisten...
Chris_Miller
Altostratus
Aug 26, 2010We 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
}
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
