Forum Discussion
Always send cookie in cookie hash persistence
The purpose is to make sure you are sending the traffic to same pool member based on cooke value which is stored in perssitence table.
Understanding cookie hash behavior
The BIG-IP system parses the Set-Cookie header in the server response and applies the Hash Offset and Hash Length settings in the cookie hash persistence profile to compose a value that the system stores in the persistence table.
When using the cookie hash persistence mode, the following sequence of events occurs:
The BIG-IP system accepts an HTTP request from a client and parses the HTTP request for the cookie as defined by the Cookie Name setting in the persistence profile. If the request does not contain the expected cookie, the BIG-IP system uses the selected load balancing mode to select a pool member and sends the connection to the selected pool member. For example, the first request from a given client does not contain the cookie, and the BIG-IP system uses the load-balancing method to select the pool member. If the request contains the expected cookie, but it does not match an existing persistence table entry, the BIG-IP system uses the selected load-balancing mode to select a pool member, sends the connection to the selected pool member, and stores the value in the persistence table. When the pool member sends the response, the BIG-IP system parses the Set-Cookie header and uses the Hash Offset and Hash Length settings in the cookie hash persistence profile to compose a value. The Hash Offset is the number of characters in the cookie value to skip before calculating the hash value (ASCII value of each character is a byte in length), and the Hash Length is the number of characters to include when calculating the hash value. The default Hash Offset value of 0 (zero) calculates the hash value at the beginning of the cookie value, and the default Hash Length value of 0 (zero) uses the entire cookie value. The BIG-IP system then stores the value in the persistence table. When the client sends a subsequent request containing the cookie, the BIG-IP system parses the cookie header and uses the offset/length settings to determine if the value matches the one stored in the persistence table. If the values match, the system persists the request to the specified pool member.
- Lukasz_KnysakFeb 17, 2019Nimbostratus
Thank you for the answer but this is not the question. This is how cookie hash persistence works, and that is OK. Unfortunately I am not aware and I can't find any information about "Always Send Cookie" for this type od persistence. Everything is clear for me when You use this in Cookie Insert method, where BIG-IP inserts its own cookie. You always use this to update the timeout value.
In Cookie Hash Persistence the cookie and the value is set by the application server and what is stored on BIG-IP is only the hash of the actual value.
In my case it is a session cookie and it's set by the application only once. It is not send in subsequent responses. There is no possibility that big-ip will insert this cookie if the application server will not for subsequent responses (and actually it doesn't - it is been tested). So what really "Always send cookie" actually means I don't know, however it has influence for specific application which "works better" with than without it.
Would be grateful if anyone has met similar issue.
Regards, Lukasz
- rob_carrFeb 18, 2019Cirrocumulus
You seem to have a pretty clear idea of what the setting should be able to do, given the circumstance of selecting 'Cookie Hash Persistence'.
When you say that an application "works better" with it, what is the behavioral change you see taking place?
- rob_carr_76748Feb 18, 2019Nimbostratus
You seem to have a pretty clear idea of what the setting should be able to do, given the circumstance of selecting 'Cookie Hash Persistence'.
When you say that an application "works better" with it, what is the behavioral change you see taking place?
- Lukasz_KnysakFeb 18, 2019Nimbostratus
Hi, in this specific case clients are not getting any 502 responses under high load after enabling "always send cookie". It should not matter but somehow it does.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com