pub fn with_session_globals<R, F>(f: F) -> Rwhere
    F: FnOnce(&SessionGlobals) -> R,