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 個回答
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
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南