Skip to content

Cookie expiration time could take Temporal.Instant or Temporal.ZonedDateTime in addition to DOMHighResTimeStampΒ #243

@ptomato

Description

@ptomato

As Temporal nears completion and is now shipping in Firefox Nightly, you could consider accepting cookie expiration times as Temporal.Instant or Temporal.ZonedDateTime objects.

Instead of this:

cookieStore.set({
    name: 'foo',
    value: 'bar',
    expires: Temporal.Now.instant().add({hours: 24}).epochMilliseconds,
});

...we could have this:

cookieStore.set({
    name: 'foo',
    value: 'bar',
    expires: Temporal.Now.instant().add({hours: 24}),
});

The latter seems preferable because the programmer doesn't have to remember that a DOMHighResTimeStamp is in milliseconds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions