set_expiry(value)
Sets the expiration time for the session. You can pass a number of different values:
- If
value
is an integer, the session will expire after that many seconds of inactivity. For example, callingrequest.session.set_expiry(300)
would make the session expire in 5 minutes. - If
value
is adatetime
ortimedelta
object, the session will expire at that specific date/time. Note thatdatetime
andtimedelta
values are only serializable if you are using thePickleSerializer
. - If
value
is0
, the user’s session cookie will expire when the user’s Web browser is closed. - If
value
isNone
, the session reverts to using the global session expiry policy.
Reading a session is not considered activity for expiration purposes. Session expiration is computed from the last time the session was modified.
Please login to continue.