Sessions always empty with flask / heroku Sessions always empty with flask / heroku heroku heroku

Sessions always empty with flask / heroku


Got the solved with some external help, mainly by changing the secret key to use a random string I came up with, instead of os.urandom(24)

Changing to server side redis sessions helped too, if only by making testing simpler


Just in case someone else comes across this question, check APPLICATION_ROOT configuration variable. I recently deployed a Flask application to a subdirectory under nginx with a reverse-proxy and setting the APPLICATION_ROOT variable broke Flask's session. Cookies aren't being set under the correct path because of that.