setAll method

void setAll(
  1. Map<String, String> cookies, {
  2. String? domain,
  3. String? path = '/',
  4. DateTime? expires,
  5. Duration? maxAge,
  6. bool httpOnly = false,
  7. bool secure = false,
  8. String? sameSite,
})

Sets multiple cookies at once.

Implementation

void setAll(
  Map<String, String> cookies, {
  String? domain,
  String? path = '/',
  DateTime? expires,
  Duration? maxAge,
  bool httpOnly = false,
  bool secure = false,
  String? sameSite,
}) {
  for (final entry in cookies.entries) {
    set(
      entry.key,
      entry.value,
      domain: domain,
      path: path,
      expires: expires,
      maxAge: maxAge,
      httpOnly: httpOnly,
      secure: secure,
      sameSite: sameSite,
    );
  }
}