Skip to content

Instantly share code, notes, and snippets.

@taonico
Created July 24, 2012 05:09
Show Gist options
  • Save taonico/3168145 to your computer and use it in GitHub Desktop.
Save taonico/3168145 to your computer and use it in GitHub Desktop.
Safari Cookies Cookies.binarycookies (ARC)
//clang -fobjc-arc -framework Foundation -o safari-cookies SafariCookiesArc.m
#import <Foundation/Foundation.h>
int main(int argc, char *argv[])
{
@autoreleasepool {
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie *c in [cookieStorage cookies])
{
NSString *cookie = [NSString stringWithFormat:@"%s %s %s %s", c.name.UTF8String, c.value.UTF8String, c.domain.UTF8String, c.path.UTF8String];
puts(cookie.UTF8String);
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment