CookieManager class

A minimal in-memory cookie jar shared across all FlutterApiCraft calls.

When ApiCookies.enableCookieJar is true, the manager:

  • Stores Set-Cookie values from response headers, keyed by domain.
  • Injects a Cookie header into subsequent requests to the same domain.

Cookies are stored only in memory and are lost when the app process ends.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildCookieHeader(String domain, ApiCookies? config, Map<String, String>? extras) → String?
Builds the Cookie header value for domain.
clearCookies([String? domain]) → void
Clears cookies for domain, or clears the entire jar when domain is null.
handleResponseCookies(String domain, Map<String, String> responseHeaders, ApiCookies? config) → void
Reads Set-Cookie from responseHeaders and persists the cookies for domain, unless config.disableCookiePersistence is true.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
storeCookies(String domain, String setCookieHeader) → void
Parses setCookieHeader and stores the resulting name/value pairs under domain.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

instance → CookieManager
The singleton instance.
final