The stickiness of an elastic load balancer can be set to one of three options
- Disable Stickiness
- Enable Load Balancer Generated Cookie Stickiness
- Enable Application Generated Cookie Stickiness
What are the differences between 2) and 3)?
Both options are going to rely on HTTP cookies to make sure that each session continues to hit the same instance.
However, with option 2 (Load Balancer Generated Cookie), the EC2 load balancer will insert it's own cookie into the HTTP transaction with a specified expiration period. With Option 3 (Application Generated Cookie), you can have the load balancer check for cookies that you are already creating with your web app (like a PHP session ID) and the expiration period of the load balancer cookie will match that one.
With the 3rd option, you have some control over how the cookie expires allowing the session to move to a different instance, but with the 2nd option, your application doesn't need to be creating any cookies.
More information on this feature: