def METHOD_NAME() -> SecureCookieSessionInterface:
    class CustomSessionInterface(SecureCookieSessionInterface):
        """Prevent creating session from API requests."""
        def should_set_cookie(self, *args, **kwargs):
            return False
        def save_session(self, *args, **kwargs):
            return
    return CustomSessionInterface()