Forum Discussion
Paul_Brand_2026
Nimbostratus
Jul 08, 2015Help on persist and/or persist add
Hello
I am newbie to F5’s and LTM’s and trying to use Universal persistence to have clients persist to a server if the serve has field of ID= and then two characters e.g. ID=25. If the field is no...
Paul_Brand_2026
Nimbostratus
Jul 09, 2015Hi Kevin
Thanks for the answer. Bit clearer now. I believe the session ID is sent in Location field, but still awaiting confirmation. Assuming it is would the below be a good approach to capture the session in the response and check requests.
when HTTP_RESPONSE {
if {[HTTP::header exists Location]} {
get next 2 characters after ID= and assign value to parameter sessid
set sessid [findstr [HTTP::header Location] "ID=" 3 2]
If value for sessid is not empty add a persistance entry
if { $sessid != "" } {
persist add uie $sessid 600
log local0. "[IP::client_addr]:[TCP::client_port], Session ID: $sessid, created persist record: [persist lookup uie $sessid]"
} else {
log local0. "[IP::client_addr]:[TCP::client_port], No Session ID"
}
}
}
when HTTP_REQUEST {
if { [HTTP::uri] contains "ID=" } {
get next 2 characters after ID= and assign value to parameter sessid
set sessid [findstr [HTTP::uri] "ID=" 3 2]
If value is not empty then persist on the session ID
if { $sessid != "" } {
persist uie $sessid }
if value is empty then no persistence
else {
persist none
}
}
}
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