Hi,
there is an issue in your irule:
if {[persist lookup uie [HTTP::header "APP-sid"]] ne ""} {
log local0. "Using APP-sid: [HTTP::header "APP-sid"]"
persist uie [HTTP::header "APP-sid"]
} else {
log local0. "Using SSL Session- setting APP-sid"
set APPSID [HTTP::header "APP-sid"]
persist uie [SSL::sessionid]
}
For the first request, persistence uie does not exist with [HTTP::header "APP-sid"]. so it is used as persistence record.
Next request, as lookup find the persistence record, you decide to not use it... which is not desired behavior.
And as persistence is set during HTTP request, there is no need to add it in the HTTP_RESPONSE event.
persist uie
command lookup in persistence table and set value if does not exist in table.
You can replace the irule with:
when HTTP_REQUEST {
log local0. "IP:[IP::client_addr] URI:[HTTP::uri] SSL:[SSL::sessionid]"
if { [HTTP::uri] starts_with "/APP" and [HTTP::header "APP-sid"] ne "LocalSession" } {
persist uie [HTTP::header "APP-sid"]
} else {
log local0. "Using SSL Session"
persist uie [SSL::sessionid]
}
}