CookieManager class
Class that implements a singleton object (shared instance) which manages the cookies used by WebView instances. On Android, it is implemented using CookieManager. On iOS, it is implemented using WKHTTPCookieStore.
NOTE for iOS below 11.0 (LIMITED SUPPORT!): in this case, almost all of the methods (CookieManager.deleteAllCookies and IOSCookieManager.getAllCookies are not supported!) has been implemented using JavaScript because there is no other way to work with them on iOS below 11.0. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies for JavaScript restrictions.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- ios ↔ IOSCookieManager
-
Contains only iOS-specific methods of CookieManager.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
deleteAllCookies(
) → Future< void> - Removes all cookies.
-
deleteCookie(
{required Uri url, required String name, String domain = "", String path = "/", InAppWebViewController? iosBelow11WebViewController}) → Future< void> -
Removes a cookie by its
name
for the givenurl
,domain
andpath
. -
deleteCookies(
{required Uri url, String domain = "", String path = "/", InAppWebViewController? iosBelow11WebViewController}) → Future< void> -
Removes all cookies for the given
url
,domain
andpath
. -
getCookie(
{required Uri url, required String name, InAppWebViewController? iosBelow11WebViewController}) → Future< Cookie?> -
Gets a cookie by its
name
for the givenurl
. -
getCookies(
{required Uri url, InAppWebViewController? iosBelow11WebViewController}) → Future< List< Cookie> > -
Gets all the cookies for the given
url
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setCookie(
{required Uri url, required String name, required String value, String? domain, String path = "/", int? expiresDate, int? maxAge, bool? isSecure, bool? isHttpOnly, HTTPCookieSameSitePolicy? sameSite, InAppWebViewController? iosBelow11WebViewController}) → Future< void> -
Sets a cookie for the given
url
. Any existing cookie with the samehost
,path
andname
will be replaced with the new cookie. The cookie being set will be ignored if it is expired. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
instance(
) → CookieManager - Gets the CookieManager shared instance.