Embed cookie allows us to embed a section of a cookie value to the cookie can be sent back to the same server. Unlike rewrite cookie, we will strip out the modifications that the ArrayOS has made in the request. so the backend will see the original cookie.
SLB Embed cookie group method
slb group method <gp_name> ec <cookie_name> [first_choice] [Threshold granularity]
<gp_name> SLB group name
<cookie_name> cookie name in which value the real server information needs to be embedded
[first_choice] rr,lc or sr (optional, default value is "rr")
[Threshold granularity] Threshold granularity if first choice method is lc (optional, default value is 10)
Please notice:
1. “ec” method can be used with default, backup and rcookie policies
2. the first HTTP request without cookie may hit the group associated with the default policy and TM will choose a real service according to [first_choice] method.
3. when TM gets the response from the server with the configured cookie name, a string containing the real server information will be embedded at the head of the cookie value by TM. Then the modified response will be forwarded to the client.
4. subsequent client requests will have the modified cookie value from which TM can know the persistent real service. TM will remove the embedded real service information from the cookie value and forward the request with original cookie value to the server. So only the cookie value between the client and TM is alternated, the cookie value between TM and the real service keeps unchanged.
5. “ec” method supports “graceful shutdown” feature, just like pc, ic and rc method. The following is an example of cookie modifications in HTTP request and response when embed cookie method is used:
Response: “CookieName = black” ==> “CookieName = r1!?black” (real service name is embedded in the response before forwarding to the client)
Request: “CookieName = r1!?black” ==> “CookieName = abcdefghijk” (real service name is removed when forwarding the request to the real server)