Forum Discussion
Julian_Annison_
Nimbostratus
Jun 21, 2005Cookie persistence with URI over ride
The rule is intended to persist on a cookie called JSESSIONID except if the uri contains jsessionid, it then uses the findstr command to pass out the jsessionid i.e. J2EE806189900 it the maps the to c...
unRuleY_95363
Jun 22, 2005Historic F5 Account
Based on this more complete information, I would have update the rule:
class WD_members {
"J2EE806189900 10.235.69.155:58000"
"J2EE806190000 10.235.69.154:58000"
"J2EE809133200 10.235.69.153:58000"
}
rule sap_version9 {
when CLIENT_ACCEPTED {
set add_persist 1
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "JSESSIONID"] and $add_persist } {
persist add uie $jsess
log local0. "HTTP response SAPCookie [HTTP::cookie JSESSIONID]"
set add_persist 0
}
}
when HTTP_REQUEST {
Note the cookie is JSESSIONID
log local0. "HTTP URL [HTTP::uri]"
log local0. "HTTP request SAPCookie [HTTP::cookie JSESSIONID]"
set jsess [findstr [HTTP::uri] "jsessionid" 12 ")"]
if { $jsess eq "" } {
log local0. "No jsessionid in URI, using cookie"
if { [HTTP::cookie exists "JSESSIONID"] } {
persist uie [HTTP::cookie "JSESSIONID"]
}
} else {
log local0. "Found jsessionid in URI: $jsess"
set node [findclass $jsess $::WD_members " "]
if { $node ne "" } {
log local0. "Sending request to $node"
pool wdsapphire_pool member $node
} else {
log local0. "Unknown J2EE key: $jsess"
}
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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