Recall & Review
beginner
What is session data storage in Flask?
Session data storage in Flask is a way to keep user-specific information across multiple requests. It stores data on the server or client to remember user actions or preferences during their visit.
Click to reveal answer
beginner
How does Flask store session data by default?
By default, Flask stores session data on the client side inside a secure cookie. This cookie is signed to prevent tampering but can only hold small amounts of data.
Click to reveal answer
beginner
What is the purpose of the secret key in Flask sessions?
The secret key is used to sign the session cookie. It ensures that the data stored in the cookie has not been changed by the user, keeping session data secure.
Click to reveal answer
beginner
How do you set a value in the Flask session?
You set a value in the Flask session like a dictionary: <br>
session['key'] = 'value'. This saves the data for the current user across requests.Click to reveal answer
intermediate
Why might you use server-side session storage instead of Flask's default?
Server-side session storage is used when you need to store more data or keep data private from the client. It stores session data on the server, improving security and capacity.
Click to reveal answer
Where does Flask store session data by default?
✗ Incorrect
Flask stores session data in a signed cookie on the client by default.
What is the role of the secret key in Flask sessions?
✗ Incorrect
The secret key signs the session cookie to ensure data integrity.
How do you access session data in Flask?
✗ Incorrect
Session data is accessed using the session dictionary in Flask.
Which of these is a reason to use server-side session storage?
✗ Incorrect
Server-side storage is better for large or sensitive data to keep it secure.
What happens if you do not set a secret key in Flask when using sessions?
✗ Incorrect
Flask requires a secret key to sign session cookies; without it, errors occur.
Explain how Flask session data storage works and why the secret key is important.
Think about how Flask keeps user info safe between pages.
You got /3 concepts.
Describe a situation where you would prefer server-side session storage over Flask's default.
Consider data size and privacy needs.
You got /3 concepts.