I'm building an iPhone app with cookies. Deleting cookies in the Safari settings doesn't delete them. Where are they stored? Is it possible to read them from another UIWebView?
Thanks!
I'm building an iPhone app with cookies. Deleting cookies in the Safari settings doesn't delete them. Where are they stored? Is it possible to read them from another UIWebView?
Thanks!
Your application has its own "cookie jar" in the [NSHTTPCookieStorage sharedHTTPCookieStorage] container.
Here's how you might take a quick look at the cookies in your application's cookie jar:
NSHTTPCookie *cookie;
NSHTTPCookieStorage *cookieJar = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [cookieJar cookies]) {
NSLog(@"%@", cookie);
}
Several methods are available for filtering and manipulation. Take a look at the NSHTTPCookieStorage documentation for accessing cookies, and the NSHTTPCookie documentation for accessing individual cookie properties.
in sandbox:Library->Cookies->Cookies.binarycookies
but you can not open the .binarycookies directly, you can run a script:
Download and install Python
Download BinaryCookieReader.py
Run "Python BinaryCookieReader.py" on the terminal
as you can see, output log contains detail cookies description