15

I am working on an app that uses NSHTTPCookieStorage to store user data. I can't get to access the cookies inside the extension, as are saved inside Library. Thank you.

Alexandru Dranca
  • 830
  • 1
  • 7
  • 21

1 Answers1

1

Cookies are not intended to be shared between applications (see NSHTTPCookieStorage).

Do you know which cookies in particular you are looking for? If you have a way of identifying the ones you want, you could copy them yourself to keychain or a shared CoreData store.

This way both your app and extension will have access to them.

Using NSHTTPCookieStorage is not a preferred way of storing user data. If you aim for simplicity and don't want CoreData or Keychain you could just use a plist. This also allows you to use NSFileProtectionComplete to provide a layer of security to the data you are storing.

kkodev
  • 2,557
  • 23
  • 23