write method

void write(
  1. String name,
  2. String value, {
  3. DateTime? expires,
  4. Duration? maxAge,
  5. String path = '/',
  6. String? domain,
  7. bool secure = false,
  8. CookieSameSite? sameSite,
})

Writes a browser cookie with common security and lifetime options.

Implementation

void write(
  String name,
  String value, {
  DateTime? expires,
  Duration? maxAge,
  String path = '/',
  String? domain,
  bool secure = false,
  CookieSameSite? sameSite,
}) {
  web.document.cookie = _buildCookie(
    name,
    value,
    expires: expires,
    maxAge: maxAge,
    path: path,
    domain: domain,
    secure: secure,
    sameSite: sameSite,
  );
}