HiveCookieManager class

Mobile cookie manager using Hive for local storage with encryption support.

This implementation provides:

  • Encrypted cookie storage using Hive
  • Token-in-URL capability for non-HTTP libraries
  • Automatic cookie injection/extraction via Dio interceptors
  • Proper handling of duplicate set-cookie headers
  • One-time migration for data consistency
Implemented types

Constructors

HiveCookieManager(Box<Map> _cookieBox)
Constructs a HiveCookieManager with the given Hive box.

Properties

hashCode int
The hash code for this object.
no setterinherited
interceptor → Interceptor
Returns the interceptor for handling cookie injection and extraction.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportsTokenInUrl bool
Indicates whether this implementation supports token-in-URL functionality.
no setteroverride

Methods

buildUrlWithToken(String url) String
Constructs a URL with an appended access token query parameter.
override
cleanupCookies(Uri uri) → void
Cleans up any corrupted or inconsistent cookie data for a specific URI.
deleteAllCookies() → void
Deletes all cookies stored in the Hive box.
override
deleteCookies(Uri uri) → void
Deletes all cookies for a specific URI.
override
getCookiesByName(Uri uri, String name) List<Cookie>
Retrieves all cookies with the specified name for debugging purposes.
getSingleCookie(Uri uri, String name) Cookie?
Retrieves a single cookie by its name for a specific URI. Returns null if the cookie is not found.
override
loadCookies(Uri uri) List<Cookie>
Loads cookies for a specific URI.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
performCookieMigration() Future<void>
Performs one-time migration to ensure cookie data consistency.
saveCookies(Uri uri, List<Cookie> cookies) → void
Saves cookies for a specific URI.
override
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

create() Future<HiveCookieManager>
Factory method to create and register a HiveCookieManager instance.