lipos_54863
Aug 18, 2009Nimbostratus
Creating a cookie on the F5s and sharing persistance between HTTP and HTTPS
Hi,
I'm working on an iRule for creating a cookie on the F5s and sharing the persistence between HTTP and HTTPS.
HTTP and HTTPS VS are sharing the same POOL since SSL offloading is being done for HTTPS.
I created something like this:
when HTTP_RESPONSE {
if { [HTTP::cookie exists "cookie_lb"] }{
persist add uie [HTTP::cookie "cookie_lb"]
log local0.debug "Cookie persist - client IP: [IP::client_addr], Cookie: [HTTP::cookie "cookie_lb"], Server IP: [IP::server_addr]"
} else {
set a_cookie [expr {int(5000 * rand())}]
HTTP::cookie insert name cookie_lb value $a_cookie
persist add uie [HTTP::cookie "cookie_lb"]
log local0.debug "Create cookie and persist - client IP: [IP::client_addr], Cookie: $a_cookie, Server IP: [IP::server_addr]"
}
}
when HTTP_REQUEST {
if { [HTTP::cookie exists "cookie_lb"] } {
persist uie [HTTP::cookie "cookie_lb"]
}
}
Is this the correct approach?
Is there a better way of doing it?