delete method

  1. @override
Future<void> delete(
  1. Uri uri, [
  2. bool withDomainSharedCookie = false
])
override

Delete cookies for specified uri. This API will delete all cookies for the uri.host, it will ignored the uri.path.

withDomainSharedCookie true will delete the domain-shared cookies.

Implementation

@override
Future<void> delete(Uri uri, [bool withDomainSharedCookie = false]) async {
  final host = uri.host;
  hostCookies.remove(host);
  if (withDomainSharedCookie) {
    domainCookies.removeWhere(
      (domain, v) => _isDomainMatch(uri.host, domain),
    );
  }
}