#2168·RestSharp

Cookies are not added to cookie container when running on iOS

Author: h-arshadCreated Feb 2, 2024Updated Jun 2, 2026
Labelsbug

When using rest sharp in NET MAUI application development, for the same API call that is supposed to inject a cookie, in Android you will see the cookie but it is missing when running in iOS device.

Code Sample:

async Task TestCookiesAsync(){
var restClient = new RestSharp.RestClient(new RestSharp.RestClientOptions()
{
  BaseUrl = new Uri("https://google.com"),
  CookieContainer = new System.Net.CookieContainer()
});
var request = new RestSharp.RestRequest("", RestSharp.Method.Get);
var response = await restClient.ExecuteAsync(request);
Console.WriteLine(response.Cookies.Count);
}

Expected behaviour: The response cookie should be added inside the cookie container.

  • OS: iOS 17.2.1 (iPhone 11 )
  • NET MAUI .NET 8
  • Rest Sharp V 110.2.0