Relative Content

Tag Archive for apacheflaskredisamazon-cloudfrontsession-cookies

Session Cookies Not Persisting in Flask App Behind Apache and CloudFront

I am new to development and have built me first application. Apologies if it my question is a bit flaky.
I’m running a Flask application on an EC2 instance behind Apache, using Waitress on port 8080, I have configured HTTPS with SSL. Despite setting the correct session configuration with Flask-Session and using Redis and ensuring cookies are set with SameSite=None, Secure=True, and HttpOnly=True, session cookies are not being set or persisted between routes when accessed via my domain (https://mydomain.live). The cookies are correctly set and persisted when running locally. My CloudFront is set to redirect HTTP to HTTPS with the origin set to HTTP on port 8080. How can I ensure the session cookies are correctly set and persisted across routes?