CloudFront
See original GitHub issueHi, I’m just trying to get my app ready for production. The app is hosted by Aws and is built like this: Route53 -> CloudFront -> ELB (no cluster, only SingleApp) CloudFront is used to make the app accessible via SSL. The Nodejs app listens on an HTTP port. Unfortunately the SessionCookie is not set. Here is my config:
session({
genid: (req) => {
return uuid() // use UUIDs for session IDs
},
secret: process.env.SESSION_SECRET,
resave: false,
saveUninitialized: false,
proxy:!dev,
store: new MongoStore({ mongooseConnection: mongoose.connection }),
rolling: true,
cookie:{
secure:!dev,
httpOnly:true,
domain:hostName,
expires: expiryDate
}
})
What am I doing wrong?
Thanks for your work 😃 .
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
Low-Latency Content Delivery Network (CDN) - AWS
Amazon CloudFront is a content delivery network (CDN) service that helps you distribute your static and dynamic content quickly and reliably with high...
Read more >Amazon CloudFront | Amazon CDN | Amazon Web Services
Amazon CloudFront is a fast content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with ...
Read more >Amazon CloudFront - Wikipedia
Amazon CloudFront is a content delivery network (CDN) operated by Amazon Web Services. Content delivery networks provide a globally-distributed network of ...
Read more >What is AWS CloudFront? Everything You Need to Know ...
AWS CloudFront is a globally-distributed network offered by Amazon Web Services, which securely transfers content such as software, SDKs, videos, etc., to the ......
Read more >Introduction to Amazon CloudFront - YouTube
Learn more about AWS CloudFront at – https://amzn.to/2UpRIG2In this video, you will learn about Amazon CloudFront. CloudFront is a fast ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Finally it works! 🎉 The solution is to select “whitelist” instead of “all” under “Cache Based on Selected Request Headers”. No idea why “all” is not “all”.
Under “WhiteList-Headers” the header “cloudfront-forwarded-proto” must be in the whitelist.
Now the following middleware must be created in the Express App before the session and cookie middleware:
Many thanks for the great help @dougwilson
Please open a new issue with your information. If you believe this is a similar issue you can link to it.