Correct option:
CloudFront cache behavior needs to be configured to forward all cookies to origin - By default, CloudFront doesn’t consider cookies when processing requests and responses, or when caching your objects in edge locations. If CloudFront receives two requests that are identical except for what’s in the Cookie header, then, by default, CloudFront treats the requests as identical and returns the same object for both requests.
You can configure CloudFront to forward to your origin some or all of the cookies in viewer requests, and to cache separate versions of your objects based on the cookie values that it forwards. When you do this, CloudFront uses some or all of the cookies in viewer requests — whichever ones it’s configured to forward—to uniquely identify an object in the cache.
To configure cookie forwarding, you update your distribution’s cache behavior. You can configure each cache behavior to do one of the following:
1.Forward all cookies to your origin – CloudFront includes all cookies sent by the viewer when it forwards requests to the origin. When your origin returns a response, CloudFront caches the response using the cookie names and values in the viewer request.
2.Forward a whitelist of cookies that you specify – CloudFront removes any cookies that the viewer sends that aren’t on the whitelist before it forwards a request to the origin. CloudFront caches the response using the names and values of the whitelisted cookies in the viewer request.
3.Don’t forward cookies to your origin – CloudFront doesn’t cache your objects based on cookies sent by the viewer. In addition, CloudFront removes cookies before forwarding requests to your origin and removes Set-Cookie headers from responses before returning responses to your viewers.
Incorrect options:
Sticky sessions need to be enabled on CloudFront distribution too for avoiding re-authentication error - This statement is incorrect, given only as a distractor.
Use CloudFront Origin Shield feature to forward authentication information to ALB - CloudFront Origin Shield is an additional layer in the CloudFront caching infrastructure that helps to minimize your origin’s load, improve its availability, and reduce its operating costs. With CloudFront Origin Shield, you get the following benefits: Better cache hit ratio, Reduced origin load, and Better network performance. Using CloudFront Origin Shield will not address the requirement for authentication.
Configure CloudFront to cache resources at edge locations to minimize the necessity for re-authentication - One of the purposes of using CloudFront is to reduce the number of requests that your origin server must respond to directly. With CloudFront caching, more objects are served from CloudFront edge locations, which are closer to your users. This reduces the load on your origin server and reduces latency. CloudFront uses edge locations inherently. Caching resources at edge locations will not address the requirement for authentication.
Reference:
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html