i am deploying a Flask app in Heroku and i am having problems with my sessions. The problem is that the sessions do not persist on heroku. When i open dev tools with f12 what i see is that when i login, it creates a cookie correctly but it just forgets it with a couple of redirects and it goes back to th main page. I tried everything and nothing works: I change my login to flask-login, i used heroku sticky-sessions, i created a new heroku app and still not working. In localhost everything works perfect and secret key is correctly setted.
I dont know what else to try. I think this is a heroku problem.
One other problem that this creates is that i made an if statement with jinja in my html to show differnt indexs if user was logged or not and now it only shows the index of not logged users:
{% if current_user.is_authenticated %}
{% else %}
Here is a link to my repo (the code is in app.py): https://github.com/deloquito/hero
And here a link to my app for you to try it out: https://cerobull.herokuapp.com
I hope someone can help me to finally find this bug, thanks everyone :)