AWS Sticky Sessions (Session Affinity) in Load Balancers

Sticky Sessions, also known as Session Affinity, allow an Elastic Load Balancer (ELB) to consistently route a client’s requests to the same backend instance. This ensures session continuity, preventing users from losing session data when making multiple requests.


How Sticky Sessions Work

Use Case for Sticky Sessions

Maintaining session data (e.g., user logins, shopping carts).

Ensuring stateful applications function correctly without relying on external session storage.

⚠️ Potential downside: Can lead to uneven load distribution if some users generate significantly more traffic than others.


Supported Load Balancers


Types of Cookies in Sticky Sessions

1️⃣ Application-Based Cookie