code: def should_set_cookie(self, app: 'Quart', session: SessionMixin) -> bool:
          
          if session.modified:
              return True
          save_each = app.config['SESSION_REFRESH_EACH_REQUEST']
          return save_each and session.permanent
docs: 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.