Created
May 3, 2017 13:22
-
-
Save dkarbayev/92f9bbc4ec92f556c7e8cb3c977c1762 to your computer and use it in GitHub Desktop.
Swift 3: Remove all cookies by URL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let cookieStorage = HTTPCookieStorage.shared | |
if let url = URL(string: Settings.apiURL), let cookies = cookieStorage.cookies(for: url) { | |
for cookie in cookies { | |
cookieStorage.deleteCookie(cookie) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment