Forum Discussion

Stéphane_PICARD's avatar
Stéphane_PICARD
Icon for Nimbostratus rankNimbostratus
Dec 03, 2015

When does F5 use Set-Cookie for persistence cookie ?

Hi all, very sorry if this questions was raised a lot of times. I swear i looked for an answer on f5.com for more than 1 hour but didn't find any clear answer.

 

Here is the question : when using the "insert mode" for cookie persistence i expected the F5 to add Set-cookie in the headers of each and every response. Means if the page my browser is trying to load is made of 11 objects (index.html + 5 jpg images + 5 css --> total 11 "get" requests) i expected the set-cookie to be set in the 11 responses (even if the F5 persistence cookie is part of the headers for the request).

 

Using the browser's developper tools i can see that it is not the case. So the question is "when / for which requests will the F5 set the persistence cookie to the answer's headers ?". Depends on what ?

 

Thank you so much to those who will take the time to answer me. With Regards

 

4 Replies

  • The Insert method appends an additional Set-Cookie header to the original HTTP response from your backend server.

     

    When does F5 append the header, adding the persistency cookie? Only if the last HTTP request from client did not present the cookie in its header. This method certainly does not instruct F5 to repeatedly overwrite the value of the cookie after each request as you are expecting.

     

    More reading here: (SOL is for v10, but the methods still function the same in v11) https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm_configuration_guide_10_0_0/ltm_persist_profiles.html1184910

     

  • Hannes Rapp beat me to the SOl. What exactly are you trying to achieve? Looks like cookie rewrite might be your solution but will require some configs on the sending servers.

     

    "The HTTP Cookie Rewrite method requires you to set up the cookie created by the server. For the HTTP Cookie Rewrite method to succeed, there needs to be a blank cookie coming from the web server for the BIG-IP system to rewrite. With Apache variants, the cookie can be added to every web page header by adding the following entry to the httpd.conf file: Header add Set-Cookie BIGipCookie=0000000000000000000000000..."

     

  • Hello, thanks a lot to all of you. I am not trying to achieve anything special BUT understand why, in some/most of the answers, i could not see the Set-Cookie from F5 and that's it. It now clear to me : "only if the last HTTP request from client did not present the cookie in its header" which was not clear to me so far.

     

    Thanks again Cheers