Session cookies between apps CloudFomration to CloudFront

0

Hello, I'm new using AWS and don't have much experience with session cookies. I've built a web app using the Remix grunge-stack and deployed it to CloudFormation. The app sets the session cookie on user login and register. The web app itself is then embedded into an Iframe inside a different widget wrapper app same style they do at https://www.intercom.com/. The widget wrapper itself is then hosted inside an S3 bucket as a static bundled JavaScript file and distributed via CloudFront to be embedded on any website. All this works except for the session Cookie being passed between the apps. The session Cookie is created through the web-app when tested as a stand alone, however, it is not set when interacting through the CloudFront widget. I've tried playing around with the CORS permissions and stuff but I've had no luck. Is what I'm trying to achieve possible and if so what am I missing? Any help would be greatly appreciated, Thanks!

1 Answer
0

CloudFront is likely not passing your session cookie through to your web app. In your CloudFront origin request policy, make sure to add your cookie name to the list of cookies that are forwarded to the origin.

Take a look at the article below, specifically the section on cookies. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html

profile pictureAWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions