Forum Discussion
patrickb323_703
Nimbostratus
Jun 12, 2009basic persistence functional behavior question
I am new to load balancers. The code below is for jsessionid persistence. What is the code actually doing here ? I'm having difficulty understanding how persistence is actually used in this context. Does persistence of some value (jsessionid) imply that subsequent requests that contain the same value for jsessionid will be routed to the same server as the initial request? And oppositely, that if a request comes in with a jsessionid that has not yet been persisted, that value gets persisted and the request is routed to whatever server load balancing algorithm determines.
I'm just not seeing the explicit routing in the code below so I think I'm missing some basic functional concept.
Thanks, Patrick
when HTTP_REQUEST {
if { [string length [HTTP::cookie exists "JSESSIONID"]] } {
Persist off of the cookie value
persist uie [HTTP::cookie "JSESSIONID"] 3600
} else {
Parse the jsessionid from the path
set jsess [findstr [string tolower [HTTP::path]] "jsessionid=" 11]
Use the jsessionid from the path for persisting
if { $jsess != "" } {
persist uie $jsess 3600
}
}
}
when HTTP_RESPONSE {
Check if there is a jsessionid cookie in the response
if { [string length [HTTP::cookie exists "JSESSIONID"]] } {
Persist off of the cookie value
persist uie [HTTP::cookie "JSESSIONID"] 3600
}
}
- hoolio
Cirrostratus
Hi Patrick,
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