- Update to 'cookie' package v1.
- Finally! Curveball v1. Only took 6 years.
- CommonJS support has been dropped. The previous version of this library supported both CommonJS and ESM. The effort of this no longer feels worth it. ESM is the future, so we're dropping CommonJS.
- Now requires Node 18.
- Upgraded to Typescript 5.3.
- The
getCsrf
function is no longer an async function, and returns the token immediately. - A warning is now emitted if
getCsrf
is called after the session has already been stored.
- This package now supports ESM and CommonJS modules.
- No longer supports Node 14. Please use Node 16 or higher.
- Session data was not stored if a later middleware threw an uncaught
exception. This middleware now uses
finally
to ensure that session data always gets stored, and theSet-Cookie
header always gets sent.
- Upgraded from
@curveball/core
to@curveball/kernel
.
- Removed
expires
option, and addedmaxAge
instead.expires
never made sense, because it represents a fixed point in time. Which means that ifexpires
was set to 1 hour in the future, the middleware would no longer generate valid sessions after the first hour the server is up. (@defrex) - Dropped Node 12 support. Node 14 is now the minimum version.
- Added 'close' method to Memory session store, so users may cleanup open timeouts. (@defrex)
- Updated everything to latest curveball standards.
- Export
SessionStore
.
- Session data should be typed as
Record<string, any>
notRecord<string, string>
.
- Major BC break: session information is now stored in
ctx.session
instead ofctx.state.session
. - Adding features for CSRF token generation and checking:
ctx.getCsrf
andctx.validateCsrf
. - Typescript target is now
es2019
instead ofesnext
to ensure that older Node.js versions are supported. - Switched to eslint.
- Changed the default setting for
SameSite
toLax
.
- Allow installation on Curveball 0.10.
- Allow 'sameSite' to be set to cookieOptions.
- Allow cookieOptions to be overridden.
- Curveball is now a peerDependency
- Update to Curveball 0.9 API
- Stricter typescript errors.
- Update to latest dependencies.
- Updated to latest Curveball API.
- Expire sessions.
- Add garbage collector to MemoryStore.
- BC break: Now uses
ctx.state.session
andctx.state.sessionId
instead ofctx.state.session.data
andctx.state.session.id
.
- SameSite and HttpOnly are both turned on.
- First version. Ships with a 'memory store'.