make get_session_pid backend agnostic