Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
On the navigation pane, under Load Balancing, choose Load Balancers.
Select your load balancer.
On the Description tab, choose Edit stickiness.
On the Edit stickiness page, select Enable load balancer generated cookie stickiness.
(Optional) For Expiration Period, type the cookie expiration period, in seconds. If you do not specify an expiration period, the sticky session lasts for the duration of the browser session.
Choose Save.