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

Ensure maxAge type has milliseconds as the unit #245

Merged
merged 1 commit into from
Apr 15, 2024
Merged

Ensure maxAge type has milliseconds as the unit #245

merged 1 commit into from
Apr 15, 2024

Conversation

chuanqisun
Copy link
Contributor

@chuanqisun chuanqisun commented Apr 15, 2024

Checklist

  • run npm run test and npm run benchmark
    • run npm run test
    • run npm run benchmark ⚠️ unable to run due to TypeError: redisStoreFactory is not a function
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message and code follows the Developer's Certification of Origin
    and the Code of conduct

@chuanqisun chuanqisun mentioned this pull request Apr 15, 2024
4 tasks
Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gurgunday
Copy link
Member

Putting for reference:

session/lib/cookie.js

Lines 41 to 45 in 8554dca

set maxAge (ms) {
this.expires = new Date(Date.now() + ms)
// we force the same originalMaxAge to match old behavior
this.originalMaxAge = ms
}

session/lib/session.js

Lines 59 to 63 in 8554dca

touch () {
if (this.cookie.originalMaxAge) {
this.cookie.expires = new Date(Date.now() + this.cookie.originalMaxAge)
}
}

@gurgunday gurgunday merged commit e1a1d93 into fastify:master Apr 15, 2024
19 checks passed
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.

2 participants