Forum Discussion
Kevin_Masui_185
Nimbostratus
Feb 02, 2015irule to persist after user logs in
is creating an irule the correct approach to persist on a server only after a website user has successfully logged in? Currently the VS is set to persist using the src_addr profile. I'm assuming th...
StephanManthey
Nacreous
Feb 04, 2015Hi,
the following iRule works the same way as the sample code on DC regarding WebLogic JSESSIONID persistence:
when HTTP_REQUEST {
if { [HTTP::cookie exists "JSESSIONID"] } {
log local0. "Client [IP::client_addr] sent cookie [HTTP::cookie "JSESSIONID"]"
persist uie [HTTP::cookie "JSESSIONID"]
log local0. "uie persist [HTTP::cookie "JSESSIONID"]"
} else {
log local0. "no JSESSIONID cookie found"
}
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "JSESSIONID"] } {
log local0. "uie persist [HTTP::cookie "JSESSIONID"] from [IP::remote_addr]"
persist add uie [HTTP::cookie "JSESSIONID"] 1800
}
}
when LB_SELECTED {
log local0. "Poolmember [LB::server] selected"
}
For testing just monitor the persistence table from CLI:
watch -n 1 tmsh show ltm persist persist-records
You can uncomment the log statements in the iRule to track the log messages in /var/log/ltm:
tail -f /var/log/ltm
Thanks, Stephan
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