This expression you made is not entirely correct:
... which creates and maintains a session on the server.
Flask-Login uses the session facilities provided by Flask, so the data stored in it is recorded by Flask using the configured session storage engine.
By default, Flask records user sessions as secure cookies in the client, but a session on the server is also possible. For example, this snippet shows how to configure Flask to record sessions in Redis server storage.
When a user session is stored in a cookie on the client side, it is pretty obvious that having multiple servers is not a problem. Cookies will be sent to the server processing each request, so everything will work fine.
For server side sessions, this also works. A server-side session is recorded under a unique identifier, and this unique identifier is then stored in a cookie on the client side. Each request then contains a session identifier, and Flask uses this identifier to load session data. If you configure all web servers to use the same user session repository, several servers can process requests from the same client without problems.
source share