function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
开发商开发商 

System.CalloutException: Empty cookie header string

I'm getting intermittent success with an http callout. Code had 100% success last week with 7 callouts. Code completed only 3 times this week. The error returned is always 'System.CalloutException: Empty cookie header string'.

Here is the request:

Http h = new Http();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
       
req.setHeader('Content-type', 'application/x-www-form-urlencoded');
req.setEndpoint('http://news.google.com/news/search');
req.setBody(queryString);     
req.setMethod('POST');
       
res = h.send(req);

Here is the log when the callout is successful:

10:00:16.102 (102784000)|SYSTEM_METHOD_ENTRY|[57]|System.Http.send(ANY)
10:00:16.102 (102879000)|CALLOUT_REQUEST|[57]|System.HttpRequest[Endpoint=http://news.google.com/news/search, Method=POST]
10:00:16.738 (738211000)|CALLOUT_RESPONSE|[57]|System.HttpResponse[Status=OK, StatusCode=200]

Here is the log when the callout errors:

10:00:15.109 (109922000)|SYSTEM_METHOD_ENTRY|[57]|System.Http.send(ANY)
10:00:15.109 (109997000)|CALLOUT_REQUEST|[57]|System.HttpRequest[Endpoint=http://news.google.com/news/search, Method=POST]
10:00:15.396 (396635000)|EXCEPTION_THROWN|[57]|System.CalloutException: Empty cookie header string
10:00:15.396 (396743000)|SYSTEM_METHOD_EXIT|[57]|System.Http.send(ANY)

Anyone run ito this before? Any ideas?
NehalNehal (Salesforce Developers) 
Hi,

This seems to be a  known issue with http-only cookies in salesforce. Please refer to the known issues link below:

https://success.salesforce.com/issues_view?id=a1p30000000T1pyAAC

Salesforce R&D team is working on this known issue and is scheduled to fix in spring'14 release.