A helper method that returns an expiration date for the session or ``None`` if the session is linked to the browser session. The default implementation returns now + the permanent session lifetime configured on the application.
(self, app: Flask, session: SessionMixin)
| 221 | return app.config["SESSION_COOKIE_PARTITIONED"] # type: ignore[no-any-return] |
| 222 | |
| 223 | def get_expiration_time(self, app: Flask, session: SessionMixin) -> datetime | None: |
| 224 | """A helper method that returns an expiration date for the session |
| 225 | or ``None`` if the session is linked to the browser session. The |
| 226 | default implementation returns now + the permanent session |
| 227 | lifetime configured on the application. |
| 228 | """ |
| 229 | if session.permanent: |
| 230 | return datetime.now(timezone.utc) + app.permanent_session_lifetime |
| 231 | return None |
| 232 | |
| 233 | def should_set_cookie(self, app: Flask, session: SessionMixin) -> bool: |
| 234 | """Used by session backends to determine if a ``Set-Cookie`` header |