• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: What does NSURLCredentialPersistenceForSession mean, exactly?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What does NSURLCredentialPersistenceForSession mean, exactly?


  • Subject: Re: What does NSURLCredentialPersistenceForSession mean, exactly?
  • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Date: Tue, 23 Feb 2016 16:04:13 +0000

On 23 Feb 2016, at 15:57, Jens Alfke <email@hidden> wrote:

> I thought this wasn’t possible anymore, since CFNetwork is implemented in C? I.e, I thought CFNetwork just made C calls to that `NSHTTPCookieStorageInternal` thing and bypassed the Obj-C API.

That situation is, well, fluid.  Historically this stuff was all in Objective-C, so subclassing worked just fine.  The introduction of the CFNetwork underpinnings made subclassing a risky proposition.  Recently more of the underpinnings are actually in Objective-C, or explicitly support subclassing properly, so this is getting better again.

> If it really is subclassable, it looks like a subclass has to reimplement the entire API by overriding and not calling `super`, correct?

Right.  I have another bug on file requesting that this be made easier <rdar://problem/16353274>.  Since filing that, however, I've found that it is easier than I originally thought, at least in the specific case of providing an alternative cookie store for NSURLSession.  IIRC you just need to override the 'task' methods:

-storeCookies:forTask:
-getCookiesForTask:completionHandler:

None of the other methods get called; I recommend you implement them as no-ops, just in case.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: What does NSURLCredentialPersistenceForSession mean, exactly?
      • From: Jens Alfke <email@hidden>
References: 
 >What does NSURLCredentialPersistenceForSession mean, exactly? (From: Jens Alfke <email@hidden>)
 >Re: What does NSURLCredentialPersistenceForSession mean, exactly? (From: "Quinn \"The Eskimo!\"" <email@hidden>)
 >Re: What does NSURLCredentialPersistenceForSession mean, exactly? (From: Jens Alfke <email@hidden>)
 >Re: What does NSURLCredentialPersistenceForSession mean, exactly? (From: "Quinn \"The Eskimo!\"" <email@hidden>)
 >Re: What does NSURLCredentialPersistenceForSession mean, exactly? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: What does NSURLCredentialPersistenceForSession mean, exactly?
  • Next by Date: Re: What does NSURLCredentialPersistenceForSession mean, exactly?
  • Previous by thread: Re: What does NSURLCredentialPersistenceForSession mean, exactly?
  • Next by thread: Re: What does NSURLCredentialPersistenceForSession mean, exactly?
  • Index(es):
    • Date
    • Thread