logo
Published on

Sticky Session

Authors
  • avatar
    Name
    Bowen Y
    Twitter

What is sticky session?

By default, an Application Load Balancer routes each request independently to a registered target based on the chosen load-balancing algorithm. However, you can use the sticky session feature (also known as session affinity) to enable the load balancer to bind a user's session to a specific target.

This ensures that all requests from the user during the session are sent to the same target. This feature is useful for servers that maintain state information in order to provide a continuous experience to clients. To use sticky sessions, the client must support cookies.

Sticky sessions are enabled at the target group level.

duration-based cookies

application-based cookies

Reference

https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html