MCPcopy Create free account
hub / github.com/pallets/quart / should_set_cookie

Method should_set_cookie

src/quart/sessions.py:85–94  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 1

save_sessionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected