Having a background in JavaScript, I have recently delved into server-side development. From my current understanding, it seems that controllers on the server-side follow a 1 to many ratio in terms of client-side interactions.
https://i.sstatic.net/HWEQn.png
My focus is on a login functionality where:
@expose('/login/', methods=('GET', 'POST'))
def login_view(self):
if request.method == 'GET':
# Render template
if request.method == 'POST':
# Retrieve email and password from form, verify user existence,
# and log them in.
login.login_user(user)
# Store user_id in session for socketio use
session['user_id'] = login.current_user.id
# Redirect
I see the session dictionary as the Python equivalent of localStorage in JavaScript. Does this imply that each unique client has its own controller? If not, wouldn't multiple clients sharing the same controller overwrite the session.user_id?