Instance Method


Flushes cookies and credentials to disk, clears transient caches, and ensures that future requests occur on a new TCP connection.


func flush(completionHandler: @escaping () -> Void)



The completion handler to call when the flush operation is complete. This handler is executed on the delegate queue.

See Also

Managing the Session

func finishTasksAndInvalidate()

Invalidates the session, allowing any outstanding tasks to finish.

func getTasksWithCompletionHandler(([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) -> Void)

Asynchronously calls a completion callback with all data, upload, and download tasks in a session.

func invalidateAndCancel()

Cancels all outstanding tasks and then invalidates the session.

func reset(completionHandler: () -> Void)

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.