Change8

session@0.2.0

Breaking Changes
📦 remixView on GitHub →
2 breaking1 features🔧 5 symbols

Summary

This release removes class-based session storage and the Session class in favor of factory functions, while introducing a new method to regenerate session IDs for improved security.

⚠️ Breaking Changes

  • The `Session` class has been removed in favor of the `createSession` factory function.
  • Class-based session storage (e.g., `FileSessionStorage`) has been removed. Use factory functions like `createFileStorage` instead.

Migration Steps

  1. Replace instances of `new FileSessionStorage(...)` with `createFileStorage(...)`.
  2. Replace manual `Session` class instantiation with the `createSession` factory function.

✨ New Features

  • Added `session.regenerateId(deleteOldSession?: boolean)` to allow purging old session data during ID regeneration to prevent session fixation attacks.

🔧 Affected Symbols

SessioncreateSessionFileSessionStoragecreateFileStoragesession.regenerateId