Forum Discussion
justjonathan_15
Nimbostratus
Apr 22, 2016Checking Persistence iRule
Hi all, We were supplied an iRule to use for a Java based application which gives out a session ID. Since deploying our F5's to this application, we have noticed strange activity with user se...
Stanislas_Piro2
Cumulonimbus
Apr 28, 2016Hi,
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]
}
}
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