Created
July 3, 2015 10:21
-
-
Save r3econ/e044c00f026c3f47610a to your computer and use it in GitHub Desktop.
NSHTTPCookieStorage (RAFExtensions)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation NSHTTPCookieStorage (RAFExtensions) | |
- (void)logCookies; | |
{ | |
NSMutableString *descriptions = [NSMutableString string]; | |
for (NSHTTPCookie *cookie in [self cookies]) | |
{ | |
[descriptions appendString:[self cookieDescription:cookie]]; | |
} | |
NSLog(@"-------- [Cookie Dump] -----------\n%@", descriptions); | |
NSLog(@"----------------------------------"); | |
} | |
- (NSString *)cookieDescription:(NSHTTPCookie *)cookie | |
{ | |
NSMutableString *description = [NSMutableString string]; | |
[description appendString:@"[NSHTTPCookie]\n"]; | |
[description appendFormat:@" name = %@\n", [cookie name]]; | |
[description appendFormat:@" value = %@\n", [cookie value]]; | |
[description appendFormat:@" domain = %@\n", [cookie domain]]; | |
[description appendFormat:@" path = %@\n", [cookie path]]; | |
[description appendFormat:@" expiresDate = %@\n", [cookie expiresDate]]; | |
[description appendFormat:@" sessionOnly = %d\n", [cookie isSessionOnly]]; | |
[description appendFormat:@" secure = %d\n", [cookie isSecure]]; | |
[description appendFormat:@" comment = %@\n", [cookie comment]]; | |
[description appendFormat:@" commentURL = %@\n", [cookie commentURL]]; | |
[description appendFormat:@" version = %lu\n", (unsigned long)[cookie version]]; | |
return description; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment