println(NSHTTPCookieStorage.sharedHTTPCookieStorage().cookies!)
when you trigger setCookie(NSHTTPCookie!)
However,
If you're doing testing on a simulator, you may notice that your cookies doesn't persist through session.
Reason is the cookies are cached and not saved out to a file immediately.
It would only occur when the app receives a SIGKILL signal, like when the debugger is stopped from within Xcode. In my experiments, unhandled exceptions, crashes, exit() and abort() don't cause NSHTPPCookieStorage to loose data.
So if you want to test if your cookie storage is working fine, QUIT the simulator instead of killing the app from Xcode
Credits to: http://stackoverflow.com/questions/5747012/nshttpcookies-refuse-to-be-deleted/15198874#15198874
No comments:
Post a Comment