Share via


NSUrlSessionHandler.UseCookies Property

Definition

Enable or disable the use of cookies.

public bool UseCookies { get; set; }
member this.UseCookies : bool with get, set

Property Value

Remarks

For default and background sessions, the shared cookie storage (SharedStorage will be used. This shared cookie storage will persist beyond app restarts; to clear the cookies call NSHttpCookieStorage.SharedStorage.RemoveCookiesSinceDate(NSDate.DistantPast). To use a custom cookie storage, use a custom NSUrlSessionConfiguration, set the HttpCookieStorage property, and then pass in the custom session configuration when creating the NSUrlSessionHandler(NSUrlSessionConfiguration).

Ephemeral sessions have by default a private cookie storage area. This private cookie storage area can't be recreated, which means that if the use of cookies is disabled, then it can't be re-enabled.

Applies to