Forum Discussion

F5-Oetti's avatar
F5-Oetti
Icon for Nimbostratus rankNimbostratus
Feb 09, 2018

Perstistance on Cookie and a secondary Cookie

Hello iRule Experts,

 

I am just in the migration of some old Cisco ACE4710.. and ran just into a little trouble..

 

At the ACE there is defined following: sticky http-cookie XXSSESSIONID MyService cookie secondary XXSSESSIONID_SIS timeout 120 replicate sticky serverfarm MyServerfarm

 

Means learn automatically the value of the Cookie XXSSESSIONID and stick the session on it for two hours.. if that cookie XXSSESSIONID is not there then look for the Cookie named XXSSESSIONID_SIS and stick the session on that for two hours...

 

I could imagine that at the F5 LTM it can be done by defining a persistance profile type Universal and bind an iRule to this profile....

 

But how must this iRule look like? Could anybody help me in this case?

 

Best Regards Gerhard

 

  • This is an example of irule for universal profile persistance:

    ltm rule persistence_rule {
        when HTTP_REQUEST {
    if { [HTTP::header exists "SessionID"] } {
        persist uie [HTTP::header value "SessionID"]
            }
        }
    when HTTP_RESPONSE {
    if { [HTTP::header exists "SessionID"] } {
        persist add uie [HTTP::header value "SessionID"]
            }
        }
    }
    

    My recommendation is give a try to the standard cookie persistence in F5, are far more efficient and probable you can achieve the same functionality.