[theplatform] use _get_netrc_login_info and fix session expiration check(#10345)