Forum Discussion

F5-Oetti's avatar
F5-Oetti
Icon for Nimbostratus rankNimbostratus
Mar 07, 2018

How can it be solved to setup persistance based on a special cookie value?

Hello,

 

I got a request to check the value of a cookie named SeSSION-ID. If the cookie value contains xxxxx or yyyyy the traffic should be forwarded to Server1. In case the cookie value contains wwwww or uuuuu the traffic should be forwarded to Server2.

 

Could that be done and if yes how can that be setup at an F5 LTM?

 

Any good information is highly appreciated.

 

Jerry

 

  • Create an irule something like this.

     when HTTP_REQUEST {
        if { [HTTP::cookie value "xxxxx"] or [HTTP::cookie value "yyyy"]} {
            node 192.168.1.1 80
        }
        elseif { [HTTP::cookie value "wwww"] or [HTTP::cookie value "uuuuu"] } {
            node 192.168.1.2 80
        }
    }
    

    Please note, only members not marked down are considered in the matching.

    -Jinshu