Skip to content

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

Open
@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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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