From 4a5c96cb80287ff4684f35773bfeb4de090d6527 Mon Sep 17 00:00:00 2001 From: ceblanda Date: Mon, 3 Oct 2016 09:28:09 -0400 Subject: [PATCH] Update NativeCookieHandler.cs add functions to delete cookies --- src/ModernHttpClient/iOS/NativeCookieHandler.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ModernHttpClient/iOS/NativeCookieHandler.cs b/src/ModernHttpClient/iOS/NativeCookieHandler.cs index 3ab5409..3a7cb64 100644 --- a/src/ModernHttpClient/iOS/NativeCookieHandler.cs +++ b/src/ModernHttpClient/iOS/NativeCookieHandler.cs @@ -27,6 +27,19 @@ public List Cookies { } } + public void DeleteCookie(Cookie c) + { + NSHttpCookieStorage.SharedStorage.DeleteCookie(ToNativeCookie(c)); + } + + public void DeleteAllCookies() + { + foreach (var c in NSHttpCookieStorage.SharedStorage.Cookies) + { + NSHttpCookieStorage.SharedStorage.DeleteCookie(c); + } + } + static NSHttpCookie ToNativeCookie(Cookie cookie) { return new NSHttpCookie(cookie);