Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions exportCookies/CookiesTXT.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,7 @@ @implementation CookiesTXT

@synthesize cookieArray;

- (NSString *) entryFromArray:(NSArray *)arr {
return [arr componentsJoinedByString:@"\t"];
}

- (void) appendEntry:(NSString *)entry toTxt:(NSString **)txt {
*txt = [*txt stringByAppendingString:[entry stringByAppendingString:@"\n"]];
}

- (void) print {
NSString *txt = @"";
for (NSHTTPCookie *cookie in self.cookieArray) {
NSMutableArray *entry = [NSMutableArray arrayWithCapacity:8];
[entry addObject:[cookie domain]];
Expand All @@ -31,10 +22,8 @@ - (void) print {
[entry addObject:[NSString stringWithFormat:@"%.0f", [[cookie expiresDate] timeIntervalSince1970]]];
[entry addObject:[cookie name]];
[entry addObject:[cookie value]];
[self appendEntry:[self entryFromArray:entry] toTxt:&txt];
}
if (txt) {
printf("%s", [txt UTF8String]);
NSString *str = [[entry componentsJoinedByString:@"\t"] stringByAppendingString:@"\n"];
printf("%s", [str UTF8String]);
}
}

Expand Down