Helper method to return if the Set Cookie header should be present. This triggers if the session is marked as modified or the app is configured to always refresh the cookie.
(self, app: Quart, session: SessionMixin)
| 83 | return None |
| 84 | |
| 85 | def should_set_cookie(self, app: Quart, session: SessionMixin) -> bool: |
| 86 | """Helper method to return if the Set Cookie header should be present. |
| 87 | |
| 88 | This triggers if the session is marked as modified or the app |
| 89 | is configured to always refresh the cookie. |
| 90 | """ |
| 91 | if session.modified: |
| 92 | return True |
| 93 | save_each = app.config["SESSION_REFRESH_EACH_REQUEST"] |
| 94 | return save_each and session.permanent |
| 95 | |
| 96 | async def open_session( |
| 97 | self, app: Quart, request: BaseRequestWebsocket |