Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS sharedCookieStorageForGroupContainerIdentifier Not working?

NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedCookieStorageForGroupContainerIdentifier:identifier];

Not working between Extensions and core app

Has Anyone been using App groups and the shared Cookie Storage to handle all the cookies between the App, Extensions, or watch. I am saving all of my cookies to this shared cookie storage but when I open an extension and check the cookies they are not there. I have set urlsession and everywhere possible to use this cookie storage but they are not persisting outside of the main ios app. I have made sure app groups are set up correctly and the identifier is the same. I have logged the cookies when exiting the app, it says they are there but logging them when opening extensions shows they are for the extensions.

Has anyone had a similar experience?

like image 703
Dom12493 Avatar asked Oct 24 '25 16:10

Dom12493


1 Answers

The problem was with the actual cookies themseleves. It seems the storage was only storing the non session cookies(ones with expiration dates) to the cookies.binarycookies file. The rest were just in memory on the app and not getting carried over. I added exp dates to the cookies and manually delete those ones later on

like image 182
Dom12493 Avatar answered Oct 26 '25 06:10

Dom12493