Explain how Flask handles session management.
Instruction: Describe the mechanisms Flask uses for session management and how you would configure it.
Context: This question probes the candidate's understanding of how Flask manages user sessions and maintains state across requests.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
Flask's default session interface stores serialized session data in a signed client-side cookie. The signature detects unauthorized changes; it does not encrypt the contents. Do not store passwords, access tokens or confidential records in that cookie merely because it is called a secure session.
This Flask3.1 demonstration writes only a public example value:...