Session is shared between two Flask apps on localhost Session is shared between two Flask apps on localhost flask flask

Session is shared between two Flask apps on localhost


I had a similar problem, and I think the cause is that both instances would use the same "session cookie" in the browser.

The solution that fixed it for me was renaming the SESSION_COOKIE_NAME which is session by default.

app.config.update(SESSION_COOKIE_NAME=<new_session_name>)

I found the solution via: https://stackoverflow.com/a/45497948/380038