pub fn create_default_session_if_not_set_then<R, F>(f: F) -> R where
    F: FnOnce(&SessionGlobals) -> R,