addCookieStorageInterceptor method

void addCookieStorageInterceptor()

Adds a cookie storage interceptor to the Dio instance.

This method adds an interceptor that automatically manages cookies for HTTP requests. The interceptor is only added on non-web platforms, as web browsers handle cookie management automatically.

Platform Support:

  • Native (iOS/Android): Adds the cookie storage interceptor
  • Web: No-op, as browsers handle cookies natively

Implementation

void addCookieStorageInterceptor() {
  if (!kIsWeb) {
    interceptors
        .add(SupaArchitecturePlatform.instance.cookieStorage.interceptor);
  }
}