Recall & Review
beginner
What is session lifetime in Flask?
Session lifetime is the time period a user's session data is kept before it expires and is removed.
Click to reveal answer
beginner
How do you set the session lifetime in Flask?
You set the session lifetime by assigning a
timedelta value to app.permanent_session_lifetime.Click to reveal answer
intermediate
What does setting
session.permanent = True do in Flask?It makes the session use the configured permanent lifetime instead of expiring when the browser closes.
Click to reveal answer
beginner
What happens if you do not set
session.permanent = True in Flask?The session will last only until the browser is closed, then it expires immediately.
Click to reveal answer
intermediate
How can you check the current session lifetime value in Flask?
You can check it by printing or logging
app.permanent_session_lifetime which shows the timedelta set.Click to reveal answer
What type of object is used to set
app.permanent_session_lifetime?✗ Incorrect
app.permanent_session_lifetime expects a timedelta object to define the session duration.If
session.permanent is False, when does the session expire?✗ Incorrect
When
session.permanent is False, the session expires as soon as the browser is closed.Which Flask setting controls how long a permanent session lasts?
✗ Incorrect
app.permanent_session_lifetime sets the duration for permanent sessions.How do you make a session permanent in Flask?
✗ Incorrect
You make a session permanent by setting
session.permanent = True inside a request.What is the default session lifetime if not set in Flask?
✗ Incorrect
By default, sessions are not permanent and expire when the browser closes.
Explain how Flask manages session lifetime and how you can control it.
Think about how long session data stays and what changes that.
You got /4 concepts.
Describe what happens when you set session.permanent to True in Flask.
Focus on session expiration behavior.
You got /3 concepts.