Recall & Review
beginner
What is the main purpose of sessions in Flask?
Sessions in Flask store information about a user across multiple requests, allowing the app to remember who the user is and keep their data while they browse.
Click to reveal answer
beginner
How do sessions help manage user state in web applications?
Sessions keep track of user data like login status or preferences between page visits, so the user doesn't have to re-enter information every time.
Click to reveal answer
intermediate
Why can't HTTP alone keep user state without sessions?
HTTP is stateless, meaning it treats each request as new and separate. Sessions add a way to remember users by storing data on the server or client.
Click to reveal answer
beginner
What kind of data is typically stored in a Flask session?
Data like user IDs, login status, shopping cart contents, or user preferences are stored in sessions to personalize the experience.
Click to reveal answer
intermediate
How does Flask keep session data secure?
Flask signs session data with a secret key to prevent tampering, ensuring that the data sent back by the user is trustworthy.
Click to reveal answer
What does a session in Flask primarily help with?
✗ Incorrect
Sessions store user data so the app can remember the user between different page visits.
Why is HTTP called stateless?
✗ Incorrect
HTTP treats each request independently without remembering previous interactions.
Which of these is NOT typically stored in a session?
✗ Incorrect
Sensitive data like passwords should never be stored in sessions in plain text.
How does Flask protect session data from being changed by users?
✗ Incorrect
Flask uses a secret key to sign session data, preventing tampering.
What happens if sessions were not used in a web app?
✗ Incorrect
Without sessions, the app cannot remember users between pages, so they must log in repeatedly.
Explain in your own words why sessions are important for managing user state in Flask.
Think about what happens when you log in and move between pages.
You got /4 concepts.
Describe how Flask keeps session data secure and why this is necessary.
Consider what could happen if users could change session data.
You got /4 concepts.