We've seen on occasion where a customer wrote a flask app and set session variables in a way that didn't persists across processes.
The mental model is that every flask response could be handled by a different process on Connect, so you need to set your session variables in a way that is process-independent.
You may want to consider using cookies to set persistent user session variables.
Also, a minimal reproducible example of a flask app that causes your observed behaviour will be valuable. Can you provide such a minimal reprex? (I'm trying to do the same and find an example app that demonstrates how to set session variables correctly.)