Cookie constructor

Cookie({
  1. required String name,
  2. required String value,
  3. required String domain,
  4. required bool hostOnly,
  5. required String path,
  6. required bool secure,
  7. required bool httpOnly,
  8. required SameSiteStatus sameSite,
  9. required bool session,
  10. double? expirationDate,
  11. required String storeId,
  12. CookiePartitionKey? partitionKey,
})

Implementation

Cookie({
  /// The name of the cookie.
  required String name,

  /// The value of the cookie.
  required String value,

  /// The domain of the cookie (e.g. "www.google.com", "example.com").
  required String domain,

  /// True if the cookie is a host-only cookie (i.e. a request's host must
  /// exactly match the domain of the cookie).
  required bool hostOnly,

  /// The path of the cookie.
  required String path,

  /// True if the cookie is marked as Secure (i.e. its scope is limited to
  /// secure channels, typically HTTPS).
  required bool secure,

  /// True if the cookie is marked as HttpOnly (i.e. the cookie is
  /// inaccessible to client-side scripts).
  required bool httpOnly,

  /// The cookie's same-site status (i.e. whether the cookie is sent with
  /// cross-site requests).
  required SameSiteStatus sameSite,

  /// True if the cookie is a session cookie, as opposed to a persistent
  /// cookie with an expiration date.
  required bool session,

  /// The expiration date of the cookie as the number of seconds since the
  /// UNIX epoch. Not provided for session cookies.
  double? expirationDate,

  /// The ID of the cookie store containing this cookie, as provided in
  /// getAllCookieStores().
  required String storeId,

  /// The partition key for reading or modifying cookies with the Partitioned
  /// attribute.
  CookiePartitionKey? partitionKey,
}) : _wrapped = $js.Cookie(
        name: name,
        value: value,
        domain: domain,
        hostOnly: hostOnly,
        path: path,
        secure: secure,
        httpOnly: httpOnly,
        sameSite: sameSite.toJS,
        session: session,
        expirationDate: expirationDate,
        storeId: storeId,
        partitionKey: partitionKey?.toJS,
      );