I have a fullstack application with a flask backend and a react frontend. The way I have been dealing with user sessions and user authentication has been through the use of flask-session. Essentially, I use redis and flask-session to create a server-side session which I use to store various information on the user.
In the local environment, when the user logs in, a cookie with the name of session and a random session value is set in the user's browser.
This cookie is then sent to the backend server on every subsequent requests, and in this way the backend server is able to retrieve the correct session from Redis.
However, when I deployed my application onto heroku, upon logging in no cookie gets set on the front-end application.
If anyone knows why this is and how this can be prevented I'd greatly appreciate it.
(P.S., upon researching I found few people saying that this is because heroku websites's domains are on Public Suffix List and that's why you can't set cookies for them - but I even purchased a custom domain and set it up and I'm still facing this issue.)