restsharp / restsharp/RestSharp

Cookies are not added to cookie container when running on iOS

Open
#2,168 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
9.8k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided RestSharp cookie sample in the reported .NET MAUI iOS environment, then compare its behavior with Android. Trace the cookie handling path used by the request and verify completion when the response cookie is added to the configured CookieContainer.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, ios
Domain
api, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.