3

CometD .NET is throwing an exception when calling the setCookie(string, string) method on BayeuxClient because I haven't set a domain for these cookies, but I don't see a property or method to set the domain, and none of the overloads on setCookie(...) take a domain as a parameter.

Code:

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 });
lukiffer
  • 11,025
  • 8
  • 46
  • 70
  • Similar to http://stackoverflow.com/questions/9519910/how-to-get-bayeux-browser-cookie-from-cometd-net-client ? – Ryan Guest Apr 25 '12 at 06:18
  • @RyanGuest, I believe that post is about cookies in the server's response. I'm trying to add cookies to the request. – lukiffer Apr 25 '12 at 18:14
  • @lukiffer, did you ever complete your integration with Salesforce? I'm attempting to do the same thing and I'm stuck http://stackoverflow.com/questions/19337723/how-do-you-add-an-authorization-header-using-cometd-net – Vyrotek Oct 12 '13 at 20:52
  • @Vyrotek, we abandoned the integration and reverted to the SOAP API. We were however successful with the streaming API, but had to implement everything ourselves using `WebClient` – lukiffer Oct 15 '13 at 22:51

0 Answers0