A stateful web application runs on EC2 instances in an Auto Scaling group behind an ALB with a single target group. The ALB is the origin for a CloudFront distribution. Users are experiencing intermittent logouts. Which two changes should the SysOps administrator implement to fix session loss? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Configure CloudFront to forward cookies in the cache behavior settings., Enable sticky sessions (target group stickiness) on the ALB target group..
Why this is the answer
For a stateful web application, maintaining user sessions is crucial. Intermittent logouts indicate session loss, meaning user requests are not consistently routed to the same backend instance or session information is not being passed correctly. Enabling sticky sessions (target group stickiness) on the ALB target group ensures that requests from a specific user are consistently routed to the same EC2 instance. This is vital for stateful applications that store session data locally on the instance. Configuring CloudFront to forward cookies in the cache behavior settings allows session cookies set by the backend application to be passed through CloudFront to the ALB and then to the EC2 instance. Without this, CloudFront might strip the cookies, preventing the ALB from maintaining session stickiness or the application from identifying the session. Switching the ALB routing algorithm to least outstanding requests is a load balancing strategy, not a session management solution. Configuring CloudFront to forward specific headers is generally for caching or custom logic, not for maintaining standard HTTP sessions. Enabling group-level stickiness on the ALB listener rule is not a standard ALB feature for session stickiness; stickiness is typically configured at the target group level.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed