Forum Discussion
lipos_54863
Nimbostratus
Aug 05, 2009persisting on a cookie
Hi,
I'm wondering is there a way to create a persistence based on a cookie when checking only first three letters of the cookie name?
Here's my example:
when HTTP_RESPONSE { ...
lipos_54863
Nimbostratus
Aug 06, 2009Thank you!
One more thing..
I got this updated iRule:
when HTTP_RESPONSE {
foreach a_cookie [HTTP::cookie names] {
if {$a_cookie starts_with "1234"}{
persist add uie [HTTP::cookie "$a_cookie"]
log local0.debug "Cookie persist - client IP: [IP::client_addr], Cookie: $a_cookie, Server IP: [IP::server_addr]"
} else {
persist source_addr 255.255.255.255 3600
log local0.debug "Source persist - client IP: [IP::client_addr] , Server IP: [IP::server_addr]"
}
}
}
when HTTP_REQUEST {
foreach a_cookie [HTTP::cookie names] {
if {$a_cookie starts_with "1234"}{
persist uie [HTTP::cookie "a_cookie"]
log local0.debug "Client IP: [IP::client_addr], Cookie value: $a_cookie"
}
}
}
I would like to persist on a cookie which starts with 1234, but if it's not available I need to run source IP persistence.
I already set this up in the HTTP_RESPONSE but I just wonder how to enable it on a VS is my primary persistence will be set to Universal.
If the fallback persistence will work in this example or I need to add more code looking up the persistence table for this IP?
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