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.