Hi Palkos-6616,
Welcome to our Microsoft Q&A platform!
Actually, in my test, cookies will be saved without any other operations.
To save the cookies, try to set "AcceptPolicy" to "NSHttpCookieAcceptPolicy.Always".
NSHttpCookieStorage.SharedStorage.AcceptPolicy = NSHttpCookieAcceptPolicy.Always
Add the following code to renderer's "OnElementChanged". Here is the reference link.
// Set cookies here
var cookieUrl = new Uri(@"https://www.microsoft.com");
var cookieJar = NSHttpCookieStorage.SharedStorage;
cookieJar.AcceptPolicy = NSHttpCookieAcceptPolicy.Always;
foreach (var aCookie in cookieJar.Cookies)
{
cookieJar.DeleteCookie(aCookie);
}
var jCookies = UserInfo.CookieContainer.GetCookies(cookieUrl);
IList<NSHttpCookie> eCookies =
(from object jCookie in jCookies
where jCookie != null
select (Cookie)jCookie
into netCookie
select new NSHttpCookie(netCookie)).ToList();
cookieJar.SetCookies(eCookies.ToArray(), cookieUrl, cookieUrl);
And you can call HttpCookieStore.GetAllCookies to get the cookies.
Regards,
Kyle
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.