An e-commerce cart service sits behind a global external Application Load Balancer and must keep each shopper pinned to one backend across requests. The team wants the load balancer to issue the affinity token itself rather than rely on the shopper's network address. Which session affinity setting should be selected?
Show answer and explanation
Answer: B
Generated cookie affinity makes the load balancer insert its own cookie into the response. Later requests that carry that cookie return to the same backend, which keeps the session stable even when many clients share one NAT address. Client IP based options tie stickiness to a source address that can change or be shared, and header field affinity relies on a value the client sends. TLS session ID is not one of the affinity modes offered for this balancer.
Why the other options are wrong
- A. Client IP and protocol affinity keys on the source address. Many shoppers behind one carrier NAT would be pinned to the same backend, and the setting does not use a cookie.
- C. Header field affinity routes based on a value supplied in a request header, which the client controls. The balancer does not issue its own token in that mode.
- D. Affinity based on TLS session ID is not offered as a backend service option for this balancer. The balancer's own cookie is the mechanism that fits this design.