CometD .NET在setCookie(string, string)
上调用BayeuxClient
方法时抛出异常,因为我没有为这些cookie设置域名,但是我没有看到设置域的属性或方法域,setCookie(...)
上没有任何重载将域作为参数。
代码:
this._bayeuxClient = new BayeuxClient(
"https://***.salesforce.com/cometd/24.0", //instance omitted
new List<ClientTransport> { new LongPollingTransport(null) });
this._bayeuxClient.setCookie("com.salesforce.LocaleInfo", "us");
//...
this._bayeuxClient.handshake(); //Exception is thrown here.
this._bayeuxClient.waitFor(1000,
new List<BayeuxClient.State> { BayeuxClient.State.CONNECTED });