Forum Discussion
JCMATTOS_41723
Nimbostratus
May 13, 2009Problems with persistence and JSESSIONID?
I have gone thru the forums and samples and tried different variations of irules to enable persistence with a JSESSIONID cookie. And I can't seem to get it to stick. I've gone thru packet captures and HTTP analyzers and have confirmed that the cookie is present and being passthru normally, but yet it doesn't seem to stick to one server. We have dual LTM's 8400 with 9.4.3 and we are loadbalancing a multi-tierd webproxy/app (webshpere) thru the F5 which looks something like this: (and an example of the cookie)
Cookie:JSESSIONID=0000Lw0zPkqZ66ejLdPuflVBf3Q:-1
CLIENT
/\
F5
/\
RP1 RP2 (Reverse Proxy Tier)
\ /
F5
/\
AP1 AP2 (Webshpere Application)
I used variations of the JSESSION sample along with others with no luck...Am I missing something? Any help is greatly appreciated? Thx!
when HTTP_REQUEST {
if { [string length [HTTP::cookie exists "JSESSIONID"]] } {
persist uie [HTTP::cookie "JSESSIONID"] 3600
} else {
set jsess [findstr [string tolower [HTTP::path]] "jsessionid=" 11]
if { $jsess != "" } {
persist uie $jsess 3600
}
}
}
when HTTP_RESPONSE {
if { [string length [HTTP::cookie exists "JSESSIONID"]] } {
persist uie [HTTP::cookie "JSESSIONID"] 3600
}
}
3 Replies
Sort By
- The_Bhattman
Nimbostratus
Do you have universal persistence profile assigned to the virtual address? - JCMATTOS_41723
Nimbostratus
Thx CM! I do have universal persistence profile enabled, not sure if it's setup right...but initially i had the irule enabled separately not in the universal profile. I did try enabling the irule in the universal profile as well. Still no sticky. I can see from a tcpdump on the F5 I'm still using both legs. Is there anything else? - JRahm
Admin
I have seen situations where the server id numbers after the jsessionID change, which would create a different persistence record. To combat that, just strip out the jsessionID from the cookie:when HTTP_REQUEST { if { ![HTTP::header exists "jsessionid"] } { set jsess_uri [findstr [HTTP::uri] "jsessionid" 11 "!"] if { $jsess_uri != "" } { persist uie $jsess_uri 3600 } } } when HTTP_RESPONSE { if { [HTTP::header exists "jsessionid"] } { set jsessID [findstr [HTTP::header "jsessionid"] "!" 1 "!"] if { $jsessID != "" } { persist add uie $jsessID 3600 } } }
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