Cancels all outstanding tasks and then invalidates the session.
- iOS 7.0+
- macOS 10.9+
- tvOS 9.0+
- watchOS 2.0+
Once invalidated, references to the delegate and callback objects are broken. After invalidation, session objects cannot be reused.
To allow outstanding tasks to run until completion, call
Managing the Session
Flushes cookies and credentials to disk, clears transient caches, and ensures that future requests occur on a new TCP connection.
Empties all cookies, caches and credential stores, removes disk files, flushes in-progress downloads to disk, and ensures that future requests occur on a new socket.