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

perf: improve idgenerator (about 25-30 % faster) #123

Merged
merged 7 commits into from
Aug 15, 2022
Merged

perf: improve idgenerator (about 25-30 % faster) #123

merged 7 commits into from
Aug 15, 2022

Conversation

Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented Aug 15, 2022

my server to run the benchmarkr

'use strict'

const Fastify = require('fastify')
const fastifySession = require('..')
const fastifyCookie = require('@fastify/cookie')

const fastify = Fastify()

fastify.register(fastifyCookie)
fastify.register(fastifySession, {
  secret: 'cNaoPYAwF60HZJzkcNaoPYAwF60HZJzk',
  cookie: { secure: false }
})

fastify.get('/', async (request, reply) => {
  reply
    .send(request.cookies.sessionId)
})

fastify.listen({ port: 3000 })

before:

autocannon  http://127.0.0.1:3000Running 10s test @ http://127.0.0.1:3000
10 connections


┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
│ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
│ Latency │ 0 ms │ 0 ms │ 0 ms  │ 1 ms │ 0.04 ms │ 0.34 ms │ 17 ms │
└─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
┌───────────┬─────────┬─────────┬────────┬─────────┬─────────┬─────────┬─────────┐
│ Stat      │ 1%      │ 2.5%    │ 50%    │ 97.5%   │ Avg     │ Stdev   │ Min     │
├───────────┼─────────┼─────────┼────────┼─────────┼─────────┼─────────┼─────────┤
│ Req/Sec   │ 16463   │ 16463   │ 22975  │ 24671   │ 22565.1 │ 2038.33 │ 16455   │
├───────────┼─────────┼─────────┼────────┼─────────┼─────────┼─────────┼─────────┤
│ Bytes/Sec │ 4.01 MB │ 4.01 MB │ 5.6 MB │ 6.01 MB │ 5.5 MB  │ 497 kB  │ 4.01 MB │
└───────────┴─────────┴─────────┴────────┴─────────┴─────────┴─────────┴─────────┘

Req/Bytes counts sampled once per second.
# of samples: 11

248k requests in 11.01s, 60.5 MB read

after:

autocannon  http://127.0.0.1:3000
Running 10s test @ http://127.0.0.1:3000
10 connections


┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
│ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
│ Latency │ 0 ms │ 0 ms │ 0 ms  │ 1 ms │ 0.04 ms │ 0.31 ms │ 19 ms │
└─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
│ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
│ Req/Sec   │ 18351   │ 18351   │ 26319   │ 27023   │ 25586.19 │ 2393.26 │ 18343   │
├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
│ Bytes/Sec │ 4.47 MB │ 4.47 MB │ 6.41 MB │ 6.58 MB │ 6.23 MB  │ 583 kB  │ 4.47 MB │
└───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘

Req/Bytes counts sampled once per second.
# of samples: 11

281k requests in 11.01s, 68.6 MB read

Checklist

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@climba03003 climba03003 left a comment

Choose a reason for hiding this comment

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

Is the performance better than using toString('base64url') ?

import { randomBytes } from 'crypto'
randomBytes(32).toString('base64url')

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Aug 15, 2022

@climba03003

There are to implications with randomBytes

  • randomBytes is not cached but randomInt is cached in nodejs, so perf of randomInt is significantly higher
  • base64url is not returning always 32 characters, as trailing = (base64-padding) are removed

@climba03003
Copy link
Member

randomBytes is not cached but randomInt is cached in nodejs, so perf of randomInt is significantly higher

randomInt only start out-perform after 5000, maybe computer dependent.

import crypto from 'crypto'
const randomBytes = crypto.randomBytes

function idGenerator (len) {
  const fnBody = []

  fnBody.push('const randomInt = crypto.randomInt;')
  fnBody.push('const base64url = \'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\'.split(\'\');')
  fnBody.push('return function () {')
  const chars = []
  for (let i = 0; i < ((len) | 0); ++i) chars.push('base64url[randomInt(0, 64)]')
  fnBody.push('return ' + chars.join('+'))
  fnBody.push('}')
  return new Function('crypto', fnBody.join(''))(crypto) // eslint-disable-line no-new-func
}

const compute1 = idGenerator(32)
const compute2 = function() {
  return randomBytes(32).toString('base64url')
}

console.time('compute1')
for(let i = 5000; i > 0; i--) {
  compute1()
}
console.timeEnd('compute1')

console.time('compute2')
for(let i = 5000; i > 0; i--) {
  compute2()
}
console.timeEnd('compute2')

base64url is not returning always 32 characters, as trailing = (base64-padding) are removed

The id should be consistence in byte length, not consistence in characters.
This plugin should be compatible with express-session store.
I am not sure if any of the store is storing the id as fixed binary length.

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Aug 15, 2022

I have also a cached randomBytes solution, which is also outperforming non-cached randomBytes.

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Aug 15, 2022

@climba03003

const crypto = require('crypto')
const randomBytes = crypto.randomBytes

const cacheSize = 24 << 7
let pos = 0
let cache = crypto.randomBytes(cacheSize)

var EQUAL_END_REGEXP = /=/
var PLUS_GLOBAL_REGEXP = /\+/g
var SLASH_GLOBAL_REGEXP = /\//g

const compute1 = Buffer.isEncoding('base64url')
? function () {
  if ((pos + 24) > cacheSize) {
    cache = crypto.randomBytes(cacheSize)
    pos = 0
  }
  const buf = Buffer.allocUnsafe(24)
  cache.copy(buf, 0, pos, (pos += 24))
  return buf.toString('base64url')
}
: function () {
  if ((pos + 24) > cacheSize) {
    cache = crypto.randomBytes(cacheSize)
    pos = 0
  }
  const buf = Buffer.allocUnsafe(24)
  cache.copy(buf, 0, pos, (pos += 24))
  return buf.toString('base64')
    .replace(EQUAL_END_REGEXP, '')
    .replace(PLUS_GLOBAL_REGEXP, '-')
    .replace(SLASH_GLOBAL_REGEXP, '_')
}

const compute2 = Buffer.isEncoding('base64url')
? function() {
  return randomBytes(32).toString('base64url')
}
: function() {
  return randomBytes(32).toString('base64')
  .replace(EQUAL_END_REGEXP, '')
  .replace(PLUS_GLOBAL_REGEXP, '-')
  .replace(SLASH_GLOBAL_REGEXP, '_')
}

console.time('compute1')
for(let i = 50000; i > 0; i--) {
  compute1()
}
console.timeEnd('compute1')

console.time('compute2')
for(let i = 50000; i > 0; i--) {
  compute2()
}
console.timeEnd('compute2')
uzlopak@Battlestation:~/workspace/session$ nvm use 12
Now using node v12.22.12 (npm v6.14.16)
uzlopak@Battlestation:~/workspace/session$ node test
compute1: 39.415ms
compute2: 80.814ms
uzlopak@Battlestation:~/workspace/session$ nvm use 14
Now using node v14.20.0 (npm v6.14.17)
uzlopak@Battlestation:~/workspace/session$ node test
compute1: 24.481ms
compute2: 69.213ms
uzlopak@Battlestation:~/workspace/session$ nvm use 18
Now using node v18.7.0 (npm v8.15.0)
uzlopak@Battlestation:~/workspace/session$ node test
compute1: 27.079ms
compute2: 114.488ms

With 5000 iterations it does not show immediatly, but it is faster in node 18

uzlopak@Battlestation:~/workspace/session$ nvm use 12
Now using node v12.22.12 (npm v6.14.16)
uzlopak@Battlestation:~/workspace/session$ node test
compute1: 10.818ms
compute2: 11.453ms
uzlopak@Battlestation:~/workspace/session$ nvm use 14
Now using node v14.20.0 (npm v6.14.17)
uzlopak@Battlestation:~/workspace/session$ node test
compute1: 9.809ms
compute2: 10.247ms
uzlopak@Battlestation:~/workspace/session$ nvm use 16
Now using node v16.16.0 (npm v8.11.0)
uzlopak@Battlestation:~/workspace/session$ node test
compute1: 7.552ms
compute2: 12.115ms
uzlopak@Battlestation:~/workspace/session$ nvm use 18
Now using node v18.7.0 (npm v8.15.0)
uzlopak@Battlestation:~/workspace/session$ node test
compute1: 6.229ms
compute2: 13.205ms

And I need to differentiate for base64url because base64url exists since node 14.18.0

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Aug 15, 2022

If i use cached randombytes i get with autocannon about 270k-278k ops/s, with randomInt I get constantly above 280k/ops, sometimes spiking to 290k /ops

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Aug 15, 2022

@kibertoad
@mcollina

How should I proceed?

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Aug 15, 2022

Ok. got it with cached randomBytes. It is definetly faster than randomInt. Got 277k ops/s on node 18 vs. randomInt 248k ops/s vs. uid-safe 212k ops/s

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Aug 15, 2022

Oh I wanted to ping @climba03003 not @kibertoad

@Uzlopak Uzlopak requested a review from climba03003 August 15, 2022 15:37
@Uzlopak Uzlopak changed the title improve idgenerator (about 15 % faster) improve idgenerator (about 25-30 % faster) Aug 15, 2022
@Uzlopak Uzlopak changed the title improve idgenerator (about 25-30 % faster) perf: improve idgenerator (about 25-30 % faster) Aug 15, 2022
@Uzlopak
Copy link
Contributor Author

Uzlopak commented Aug 15, 2022

I guess everybody is happy :)

@Uzlopak Uzlopak merged commit 32bdbec into fastify:master Aug 15, 2022
@Uzlopak Uzlopak deleted the improve-idGenerator branch August 15, 2022 19:22
bodinsamuel referenced this pull request in specfy/specfy Aug 21, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@fastify/session](https://togithub.com/fastify/session) | [`10.2.0`
->
`10.4.0`](https://renovatebot.com/diffs/npm/@fastify%2fsession/10.2.0/10.4.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@fastify%2fsession/10.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@fastify%2fsession/10.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@fastify%2fsession/10.2.0/10.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@fastify%2fsession/10.2.0/10.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>fastify/session (@&#8203;fastify/session)</summary>

###
[`v10.4.0`](https://togithub.com/fastify/session/releases/tag/v10.4.0)

[Compare
Source](https://togithub.com/fastify/session/compare/v10.3.1...v10.4.0)

#### What's Changed

- fix: make sure to set cookie on manual session saves by
[@&#8203;SimenB](https://togithub.com/SimenB) in
[https://github.com/fastify/session/pull/203](https://togithub.com/fastify/session/pull/203)

**Full Changelog**:
fastify/session@v10.3.1...v10.4.0

###
[`v10.3.1`](https://togithub.com/fastify/session/releases/tag/v10.3.1)

[Compare
Source](https://togithub.com/fastify/session/compare/v10.3.0...v10.3.1)

#### What's Changed

- ci: only trigger on pushes to main branches by
[@&#8203;Fdawgs](https://togithub.com/Fdawgs) in
[https://github.com/fastify/session/pull/198](https://togithub.com/fastify/session/pull/198)
- build(deps-dev): bump
[@&#8203;types/node](https://togithub.com/types/node) from 18.16.5 to
20.1.0 by [@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/fastify/session/pull/199](https://togithub.com/fastify/session/pull/199)
- fix: manually persisting the session should make `isModified` return
false by [@&#8203;SimenB](https://togithub.com/SimenB) in
[https://github.com/fastify/session/pull/201](https://togithub.com/fastify/session/pull/201)

**Full Changelog**:
fastify/session@v10.3.0...v10.3.1

###
[`v10.3.0`](https://togithub.com/fastify/session/releases/tag/v10.3.0)

[Compare
Source](https://togithub.com/fastify/session/compare/v10.2.1...v10.3.0)

#### What's Changed

- build(deps-dev): bump sinon from 13.0.2 to 14.0.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/fastify/session/pull/88](https://togithub.com/fastify/session/pull/88)
- update to Fastify v4 by
[@&#8203;mcollina](https://togithub.com/mcollina) in
[https://github.com/fastify/session/pull/89](https://togithub.com/fastify/session/pull/89)
- feat: Update benchmark. by
[@&#8203;ShogunPanda](https://togithub.com/ShogunPanda) in
[https://github.com/fastify/session/pull/91](https://togithub.com/fastify/session/pull/91)
- ci: migrate to fastify reusable workflow by
[@&#8203;Fdawgs](https://togithub.com/Fdawgs) in
[https://github.com/fastify/session/pull/90](https://togithub.com/fastify/session/pull/90)
- build(deps-dev): bump fastify-cookie from 5.6.1 to 5.7.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/fastify/session/pull/92](https://togithub.com/fastify/session/pull/92)
- docs(readme): remove snyk badge by
[@&#8203;Fdawgs](https://togithub.com/Fdawgs) in
[https://github.com/fastify/session/pull/93](https://togithub.com/fastify/session/pull/93)
- chore(.gitignore): use updated skeleton template by
[@&#8203;Fdawgs](https://togithub.com/Fdawgs) in
[https://github.com/fastify/session/pull/96](https://togithub.com/fastify/session/pull/96)
- build(deps-dev): bump
[@&#8203;types/node](https://togithub.com/types/node) from 17.0.45 to
18.0.0 by [@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/fastify/session/pull/97](https://togithub.com/fastify/session/pull/97)
- build(deps-dev): bump tsd from 0.20.0 to 0.21.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/fastify/session/pull/98](https://togithub.com/fastify/session/pull/98)
- build(deps-dev): bump tsd from 0.21.0 to 0.22.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/fastify/session/pull/102](https://togithub.com/fastify/session/pull/102)
- style(types/types.test-d.ts): explicitly declare semicolon by
[@&#8203;Fdawgs](https://togithub.com/Fdawgs) in
[https://github.com/fastify/session/pull/103](https://togithub.com/fastify/session/pull/103)
- refactor: use optional chaining by
[@&#8203;Fdawgs](https://togithub.com/Fdawgs) in
[https://github.com/fastify/session/pull/104](https://togithub.com/fastify/session/pull/104)
- build(deps): bump fastify-plugin from 3.0.1 to 4.0.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/fastify/session/pull/105](https://togithub.com/fastify/session/pull/105)
- remove metadata.js by [@&#8203;Uzlopak](https://togithub.com/Uzlopak)
in
[https://github.com/fastify/session/pull/107](https://togithub.com/fastify/session/pull/107)
- separate lint from npm test script, activate lint and license-check in
ci pipeline by [@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/108](https://togithub.com/fastify/session/pull/108)
- refactor unit tests, replace ava with tap, remove undici and
typescript as devDependencies by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/109](https://togithub.com/fastify/session/pull/109)
- move benchmark to corresponding folder, slim it down by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/110](https://togithub.com/fastify/session/pull/110)
- tap should only run test.js files by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/115](https://togithub.com/fastify/session/pull/115)
- Clean up tests by
[@&#8203;rclmenezes](https://togithub.com/rclmenezes) in
[https://github.com/fastify/session/pull/117](https://togithub.com/fastify/session/pull/117)
- Add missing documentation for README.md by
[@&#8203;rclmenezes](https://togithub.com/rclmenezes) in
[https://github.com/fastify/session/pull/116](https://togithub.com/fastify/session/pull/116)
- Simplify shouldSaveSession code a little bit by
[@&#8203;rclmenezes](https://togithub.com/rclmenezes) in
[https://github.com/fastify/session/pull/119](https://togithub.com/fastify/session/pull/119)
- Move `expires` from session to session.cookies by
[@&#8203;rclmenezes](https://togithub.com/rclmenezes) in
[https://github.com/fastify/session/pull/120](https://togithub.com/fastify/session/pull/120)
- refactor store to es6 class by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/122](https://togithub.com/fastify/session/pull/122)
- simplify callback typing by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/124](https://togithub.com/fastify/session/pull/124)
- Add cookiePrefix as an option to allow for compatibility with
express-session by [@&#8203;rclmenezes](https://togithub.com/rclmenezes)
in
[https://github.com/fastify/session/pull/113](https://togithub.com/fastify/session/pull/113)
- perf: improve idgenerator (about 25-30 % faster) by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/123](https://togithub.com/fastify/session/pull/123)
- chore: remove addDataToSession by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/127](https://togithub.com/fastify/session/pull/127)
- add autocannon example by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/128](https://togithub.com/fastify/session/pull/128)
- feat: use
[@&#8203;fastify/cookie-signer-logic](https://togithub.com/fastify/cookie-signer-logic)
for signing and unsigning by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/129](https://togithub.com/fastify/session/pull/129)
- move signer require into ensureDefaults by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/130](https://togithub.com/fastify/session/pull/130)
- fix unit test by [@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/132](https://togithub.com/fastify/session/pull/132)
- fix lgtm alert by [@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/133](https://togithub.com/fastify/session/pull/133)
- Remove session id round 4 by
[@&#8203;rclmenezes](https://togithub.com/rclmenezes) in
[https://github.com/fastify/session/pull/134](https://togithub.com/fastify/session/pull/134)
- simplify getExpires, export getExpires from cookie by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/135](https://togithub.com/fastify/session/pull/135)
- remove internal used session restore() function by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/136](https://togithub.com/fastify/session/pull/136)
- Revert "refactor store to es6 class" by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/138](https://togithub.com/fastify/session/pull/138)
- remove sinon as dev dependency by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/139](https://togithub.com/fastify/session/pull/139)
- add redis example by [@&#8203;Uzlopak](https://togithub.com/Uzlopak)
in
[https://github.com/fastify/session/pull/142](https://togithub.com/fastify/session/pull/142)
- add pre-commit by [@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/145](https://togithub.com/fastify/session/pull/145)
- add unit test for maxAge by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/144](https://togithub.com/fastify/session/pull/144)
- create a separate unit test file for memorystore by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/150](https://togithub.com/fastify/session/pull/150)
- rename secret.test.js to fastifySession.checkOptions.test.js and
refactor it by [@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/151](https://togithub.com/fastify/session/pull/151)
- prevent encryptedSessionId from being stored in the sessionStore by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/143](https://togithub.com/fastify/session/pull/143)
- use maxAge over expires by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/152](https://togithub.com/fastify/session/pull/152)
- build(deps-dev): bump tsd from 0.22.0 to 0.23.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/fastify/session/pull/153](https://togithub.com/fastify/session/pull/153)
- Resave session cookie if saveUninitialized is false and rolling is
true by [@&#8203;rclmenezes](https://togithub.com/rclmenezes) in
[https://github.com/fastify/session/pull/149](https://togithub.com/fastify/session/pull/149)
- rename session to fastifySession by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/160](https://togithub.com/fastify/session/pull/160)
- Make it possible to call save() in decryptSession by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/161](https://togithub.com/fastify/session/pull/161)
- Implement originalMaxAge by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/162](https://togithub.com/fastify/session/pull/162)
- Remove deprecation notice for fastify-Instance decryptSession by
[@&#8203;shrihari-prakash](https://togithub.com/shrihari-prakash) in
[https://github.com/fastify/session/pull/164](https://togithub.com/fastify/session/pull/164)
- add typings for decryptSession by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/165](https://togithub.com/fastify/session/pull/165)
- simplify cookie handling by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/166](https://togithub.com/fastify/session/pull/166)
- minor cosmetic change by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/167](https://togithub.com/fastify/session/pull/167)
- ensure that secure false is not overwritten by null by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/168](https://togithub.com/fastify/session/pull/168)
- security: verify path of cookie/session by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/169](https://togithub.com/fastify/session/pull/169)
- build(deps-dev): bump tsd from 0.23.0 to 0.24.1 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/fastify/session/pull/171](https://togithub.com/fastify/session/pull/171)
- Little remark fastify-cookie ->
[@&#8203;fastify/cookie](https://togithub.com/fastify/cookie) by
[@&#8203;Luchanso](https://togithub.com/Luchanso) in
[https://github.com/fastify/session/pull/172](https://togithub.com/fastify/session/pull/172)
- fix rolling location in doc by
[@&#8203;HPieters](https://togithub.com/HPieters) in
[https://github.com/fastify/session/pull/175](https://togithub.com/fastify/session/pull/175)
- fix: set domain when clearing cookie by
[@&#8203;TheWashiba](https://togithub.com/TheWashiba) in
[https://github.com/fastify/session/pull/174](https://togithub.com/fastify/session/pull/174)
- fix: align cookie implementation with express-session by
[@&#8203;climba03003](https://togithub.com/climba03003) in
[https://github.com/fastify/session/pull/177](https://togithub.com/fastify/session/pull/177)
- nodenext compatibility by
[@&#8203;Uzlopak](https://togithub.com/Uzlopak) in
[https://github.com/fastify/session/pull/178](https://togithub.com/fastify/session/pull/178)
- build(deps-dev): bump tsd from 0.24.1 to 0.25.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/fastify/session/pull/179](https://togithub.com/fastify/session/pull/179)
- types: fix Session interface reference by
[@&#8203;FabianFrank](https://togithub.com/FabianFrank) in
[https://github.com/fastify/session/pull/182](https://togithub.com/fastify/session/pull/182)
- chore(.gitignore): add clinic by
[@&#8203;Fdawgs](https://togithub.com/Fdawgs) in
[https://github.com/fastify/session/pull/183](https://togithub.com/fastify/session/pull/183)
- chore(.gitignore): add bun lockfile by
[@&#8203;Fdawgs](https://togithub.com/Fdawgs) in
[https://github.com/fastify/session/pull/185](https://togithub.com/fastify/session/pull/185)
- build(deps-dev): bump connect-redis from 6.1.3 to 7.0.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/fastify/session/pull/186](https://togithub.com/fastify/session/pull/186)
- build(deps-dev): bump tsd from 0.25.0 to 0.27.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/fastify/session/pull/187](https://togithub.com/fastify/session/pull/187)
- build(deps-dev): bump tsd from 0.27.0 to 0.28.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/fastify/session/pull/188](https://togithub.com/fastify/session/pull/188)
- fix: express session type compatibility by
[@&#8203;ojeytonwilliams](https://togithub.com/ojeytonwilliams) in
[https://github.com/fastify/session/pull/190](https://togithub.com/fastify/session/pull/190)
- feat: add ignoreFields option to regenerate method by
[@&#8203;RafaelGSS](https://togithub.com/RafaelGSS) in
[https://github.com/fastify/session/pull/189](https://togithub.com/fastify/session/pull/189)
- fix: separate an actual path from url search part before verification
by [@&#8203;ohchi](https://togithub.com/ohchi) in
[https://github.com/fastify/session/pull/192](https://togithub.com/fastify/session/pull/192)
- fix: lint by [@&#8203;Eomm](https://togithub.com/Eomm) in
[https://github.com/fastify/session/pull/195](https://togithub.com/fastify/session/pull/195)
- feat!: stricter types by
[@&#8203;climba03003](https://togithub.com/climba03003) in
[https://github.com/fastify/session/pull/196](https://togithub.com/fastify/session/pull/196)

#### New Contributors

- [@&#8203;mcollina](https://togithub.com/mcollina) made their first
contribution in
[https://github.com/fastify/session/pull/89](https://togithub.com/fastify/session/pull/89)
- [@&#8203;ShogunPanda](https://togithub.com/ShogunPanda) made their
first contribution in
[https://github.com/fastify/session/pull/91](https://togithub.com/fastify/session/pull/91)
- [@&#8203;Uzlopak](https://togithub.com/Uzlopak) made their first
contribution in
[https://github.com/fastify/session/pull/107](https://togithub.com/fastify/session/pull/107)
- [@&#8203;rclmenezes](https://togithub.com/rclmenezes) made their first
contribution in
[https://github.com/fastify/session/pull/117](https://togithub.com/fastify/session/pull/117)
- [@&#8203;shrihari-prakash](https://togithub.com/shrihari-prakash) made
their first contribution in
[https://github.com/fastify/session/pull/164](https://togithub.com/fastify/session/pull/164)
- [@&#8203;Luchanso](https://togithub.com/Luchanso) made their first
contribution in
[https://github.com/fastify/session/pull/172](https://togithub.com/fastify/session/pull/172)
- [@&#8203;HPieters](https://togithub.com/HPieters) made their first
contribution in
[https://github.com/fastify/session/pull/175](https://togithub.com/fastify/session/pull/175)
- [@&#8203;TheWashiba](https://togithub.com/TheWashiba) made their first
contribution in
[https://github.com/fastify/session/pull/174](https://togithub.com/fastify/session/pull/174)
- [@&#8203;FabianFrank](https://togithub.com/FabianFrank) made their
first contribution in
[https://github.com/fastify/session/pull/182](https://togithub.com/fastify/session/pull/182)
- [@&#8203;ojeytonwilliams](https://togithub.com/ojeytonwilliams) made
their first contribution in
[https://github.com/fastify/session/pull/190](https://togithub.com/fastify/session/pull/190)
- [@&#8203;RafaelGSS](https://togithub.com/RafaelGSS) made their first
contribution in
[https://github.com/fastify/session/pull/189](https://togithub.com/fastify/session/pull/189)
- [@&#8203;ohchi](https://togithub.com/ohchi) made their first
contribution in
[https://github.com/fastify/session/pull/192](https://togithub.com/fastify/session/pull/192)
- [@&#8203;Eomm](https://togithub.com/Eomm) made their first
contribution in
[https://github.com/fastify/session/pull/195](https://togithub.com/fastify/session/pull/195)

**Full Changelog**:
fastify/session@v8.3.0...v10.3.0

###
[`v10.2.1`](https://togithub.com/fastify/session/releases/tag/v10.2.1)

[Compare
Source](https://togithub.com/fastify/session/compare/v10.2.0...v10.2.1)

#### What's Changed

- fix: separate an actual path from url search part before verification
by [@&#8203;ohchi](https://togithub.com/ohchi) in
[https://github.com/fastify/session/pull/192](https://togithub.com/fastify/session/pull/192)
- fix: lint by [@&#8203;Eomm](https://togithub.com/Eomm) in
[https://github.com/fastify/session/pull/195](https://togithub.com/fastify/session/pull/195)

#### New Contributors

- [@&#8203;ohchi](https://togithub.com/ohchi) made their first
contribution in
[https://github.com/fastify/session/pull/192](https://togithub.com/fastify/session/pull/192)
- [@&#8203;Eomm](https://togithub.com/Eomm) made their first
contribution in
[https://github.com/fastify/session/pull/195](https://togithub.com/fastify/session/pull/195)

**Full Changelog**:
fastify/session@v10.2.0...v10.2.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 10pm every weekday" in timezone
Europe/Paris, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/specfy/specfy).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi40My4yIiwidXBkYXRlZEluVmVyIjoiMzYuNDMuMiIsInRhcmdldEJyYW5jaCI6ImNob3JlL3Jlbm92YXRlQmFzZUJyYW5jaCJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

3 participants