NSHTTPCookieStorage API not able to access cookie on OS X 10.11 beta 2 ?

We are not able to read cookies using NSHTTPCookieStorage API. Both cookiesForURL and cookies property return an empty array on OS X 10.11 beta 2 . We have tried using the third party tool in Mac which directly reads from Cookies.binarycookies and we find that we are able to read the cookies using the tool. We checked the the location ~/Library/Cookies and we see that cookies are getting stored in Cookies.binarycookies and also we are able to read the cookies with third party tool which directly reads from the Cookies.binarycookies and not using NSHTTPCookieStorage.



We use cookies in our features implemented in the client

Steps to Reproduce:

Write a sample program to access the cookies in Safari as shown below

NSArray *array = [NSHTTPCookieStorage sharedHTTPCookieStorage].cookies; 
NSLog(@“cookies :%@ cookie count:%lu”,array,(unsigned long)array.count);

Compile and run the program on OS X 10.10 and OS X 10.11 beta 2

Expected Results:

The program prints out the cookies on the screen along with their count


Actual Results:

On OS X 10.11 beta 2 , the program prints a empty array and the cookie count is 0. This program works on OS X 10.11 beta 2. The code works perfectly in 10.10. Version: OS X build version: 10.10.4 Xcode Version : Xcode 7 beta 2 and Xcode 6.4.

I got similar issue.


Before upgrading to OS X 10.11 beta 2, the cookies in the Safari are able to be shared with OSX program, which implying one can manipulate cookies in the Safari in order to achieve some purposes in the OSX program. But this advantage has been gone in OS X 10.11 beta 2. This change sabotages my current working flow and makes my server-side program unable to work. Totally regret to upgrade to El Capitan 😟.

NSHTTPCookieStorage API not able to access cookie on OS X 10.11 beta 2 ?
 
 
Q