WebLogic universal persistance - multiple (JSESSIONID) cookie names
Hello experts,
we have a customer which uses a Java Web-Application hosted on WebLogic middleware. In the past this was quite simple, we used this iRule for managing the universal persistance:
when HTTP_REQUEST {
if { [HTTP::cookie "JSESSIONID"] ne "" }{
persist uie [string tolower [HTTP::cookie "JSESSIONID"]] 300
} else {
set jsess [findstr [string tolower [HTTP::path]] "jsessionid=" 11]
if { $jsess != "" } {
persist uie $jsess 300
}
}
}
when HTTP_RESPONSE {
if { [HTTP::cookie "JSESSIONID"] ne "" }{
persist add uie [string tolower [HTTP::cookie "JSESSIONID"]] 300
}
}
This worked ever fine. But now the customer has multiple Java Web-Applications configured in WebLogic, each of them uses seperate Cookie names. So JSESSIONID (as before), but also new SESSIONIDA, JSESSIONIDB and JSESSIONIDC. All must be served over one Loadbalancer virtual server, we we have to manage the complexity in the iRule on the F5.
Note: We can use the same selected node node for one client, but also seperate per Cookie name, so per application to another selected node in the Backend - this is not relevant.
This is what I think it should work, but it doesn't. Please don't blame me regarding efficiency, I know it is worse. (But am no iRule expert.) Pure funcionality is Prio-1 for us.
when HTTP_REQUEST {
if { [HTTP::cookie "JSESSIONID"] ne "" }
{ persist uie [string tolower [HTTP::cookie "JSESSIONID"]] 300 }
elseif { [HTTP::cookie "JSESSIONIDA"] ne "" }
{ persist uie [string tolower [HTTP::cookie "JSESSIONIDA"]] 300 }
elseif { [HTTP::cookie "JSESSIONIDB"] ne "" }
{ persist uie [string tolower [HTTP::cookie "JSESSIONIDB"]] 300 }
elseif { [HTTP::cookie "JSESSIONIDC"] ne "" }
{ persist uie [string tolower [HTTP::cookie "JSESSIONIDC"]] 300 }
else {
set jsess [findstr [string tolower [HTTP::path]] "jsessionid=" 11]
if { $jsess != "" } {persist uie $jsess 300 }
else {
set jsess [findstr [string tolower [HTTP::path]] "jsessionida=" 11]
if { $jsess != "" } { persist uie $jsess 300 }
else {
set jsess [findstr [string tolower [HTTP::path]] "jsessionidb" 11]
if { $jsess != "" } { persist uie $jsess 300 }
else {
set jsess [findstr [string tolower [HTTP::path]] "jsessionidc" 11]
if { $jsess != "" } { persist uie $jsess 300 }
}
}
}
}
}
when HTTP_RESPONSE {
if { [HTTP::cookie "JSESSIONID"] ne "" }{
persist add uie [string tolower [HTTP::cookie "JSESSIONID"]] 300
}
if { [HTTP::cookie "JSESSIONIDA"] ne "" }{
persist add uie [string tolower [HTTP::cookie "JSESSIONIDA"]] 300
}
if { [HTTP::cookie "JSESSIONIDB"] ne "" }{
persist add uie [string tolower [HTTP::cookie "JSESSIONIDB"]] 300
}
if { [HTTP::cookie "JSESSIONIDC"] ne "" }{
persist add uie [string tolower [HTTP::cookie "JSESSIONIDC"]] 300
}
}
I would like to thank you in advance for any hint on my problem here...