x_check_session more robust