Forum Discussion

Chris_Scales_10's avatar
Chris_Scales_10
Icon for Nimbostratus rankNimbostratus
May 27, 2008

irule cookie persistence using query parameter

Hello,

 

 

I'm new to iRules and TCL in general and need a bit of help.

 

 

I'd like to use F5LTM cookie insert persistence profile to select the server to send the user's request to based on a F5LTM issued cookie.

 

 

Due to an application bug, there are two instances where the the F5LTM cookie will be not be sent in the Cookie HTTP headers, but instead it will be sent as a query parameter.

 

This is unavoidable, and it happens in two cases:

 

(1) the application does not send Cookies for file uploads

 

(2) requests for contents are send to a different domain, and cookies cannot span different domains.

 

 

For these two cases, we plan to add the cookie as a query parameter to the URL. This query parameter we'll be called "lcb", unless you want to use a different name. We will need to create an irule to extract the cookie from the query parameter and use it to select a server.

 

 

Here are the conditions to consider:

 

 

(1) If the F5LTM Cookie is present, then F5LTM will use cookie affinity to select the server and will send the cookie to the server.

 

 

(2) If the F5LTM Cookie is not present and the URL is domain1.com/adc/upload or domain2.com, then execute the irule and extract the lcb query parameter and thus select the server to send the request to.

 

If the lcb parameter is not present, then create a new cookie and select a server.

 

 

Any help would be appreciated.

1 Reply

  • It sounds like you want to configure a cookie insert persistence profile (probably with no timeout to use a session cookie). The BIG-IP would insert a session cookie in the response to the client whenever the client doesn't include the persistence cookie in that request.

     

     

    As for item 2, do both domains resolve to VIPs on the BIG-IP? If so, do both VIPs point to the same pool? If both of those are true, then it might be possible to persist the same client to the same server. If not, can you explain what type of persistence behavior you're trying to achieve between the two domains?

     

     

    Aaron