It’s unclear what the exact behavior of NSURLCredentialPersistenceForSession 
is. The doc says nothing but "This credential will only be stored for this 
session,” but it doesn’t define what a “session” is. (Keep in mind that this 
API came out nine years before NSURLSession.)

— I’ve always interpreted it as “process”, i.e. the credential will be globally 
available but only until the process exits.

— It could also mean “per NSURLCredentialStorage”, which is equivalent to “per 
process” because that class is a singleton*.

— It’s possible that these days it _does_ correspond to “per NSURLSession”, but 
I don’t see anything that says so. If it did, that would be very useful for my 
project, which needs to be able to communicate with the same REST API 
simultaneously as different user accounts.

Could someone clarify?

—Jens

* which makes me wonder why NSURLSessionConfiguration has a 
URLCredentialStorage property, since there’s no way to create another object to 
point that property at. Same goes for the HTTPCookieStorage property.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to