Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cookie maxAge should be in seconds #776

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

hmnd
Copy link

@hmnd hmnd commented Apr 28, 2024

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Cookie maxAge is currently being set to 1000 years, since maxAge is specified in seconds, not milliseconds.

What is the new behavior?

Cookie maxAge is 365 days (1 year), below the maxAge limit of 400 days (https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-13#section-4.1.2.2)

Additional context

Sorry for creating #765 again, but I don't think it's being monitored anymore now that it is closed.

As detailed in the earlier PR, this is seriously affecting usability for us with Hono, as it's currently requiring me to re-patch @supabase/ssr every time a new update to the package is released.

@hmnd hmnd requested a review from a team as a code owner April 28, 2024 03:57
@j4w8n
Copy link

j4w8n commented Apr 29, 2024

I'm pro rfc-adherence. The only pushback I can possibly see is that the Proposed Standard rfc 6265 does not define a limit; only this new draft does.

It may have been unwise for Hono to have a hard failure for this; but at the same time, 365 days, or 400, seems reasonable and easily changeable by Supabase.

If anyone logs into a website, then closes the browser and waits a year to go back to that site, it's reasonable to expect them to log in again.

@hmnd
Copy link
Author

hmnd commented May 22, 2024

@j4w8n fyi, Chrome, Safari, and Firefox have all agreed on this limit and at least Chrome has shipped this limit in v104. Nonetheless, I do agree that Hono shouldn't be forcing this onto its users and have thus opened an issue there too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants