Skip to content

Releases: amphp/http-server-session

3.0.1

12 Jan 20:21
v3.0.1
1cac38d

Choose a tag to compare

What's Changed

  • Add examples & docs by @thgs in #16
  • Fix nullable deprecations for PHP 8.4 by @bwoebi in 776b57e
  • Extend paragonie/constant_time_encoding version coverage by @wtsergo in #18

New Contributors

Full Changelog: v3.0.0...v3.0.1

3.0.0

20 Aug 18:31
v3.0.0
88ee210

Choose a tag to compare

This release is compatible with amphp/http-server@^3.

  • Renamed Storage, InMemoryStorage, RedisStorage, DefaultIdGenerator, and Driver to SessionStorage, LocalSessionStorage, RedisSessionStorage, Base64UrlSessionIdGenerator, and SessionFactory, respectively
  • Renamed methods on Session: open() to lock(), save() to commit()
  • Added Session::rollback() to undo local changes and re-read the session data from storage
  • Added SessionTrainer for examining session changes unit testing

3.0.0 Beta 2

22 Apr 16:09
v3.0.0-beta.2
f352b9c

Choose a tag to compare

3.0.0 Beta 2 Pre-release
Pre-release
  • Compatibility with amphp/http@v2

2.0.1

25 Mar 15:01
v2.0.1
27566d2

Choose a tag to compare

  • Fix deprecated string interpolation style

3.0.0 Beta 1

30 May 18:56
v3.0.0-beta.1

Choose a tag to compare

3.0.0 Beta 1 Pre-release
Pre-release

Initial release compatible with AMPHP v3.

As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> have been replaced with ResolutionType.

Basic usage of this library remains the same as in v2: Add SessionMiddleware as part of your request handler stack and access the Session object using Request::getAttribute(Session::class). The session storage and some behaviors may be customized using the constructor of SessionMiddleware.

  • Added Session prefix to interfaces:
    • IdGenerator renamed to SessionIdGenerator; implementation DefaultIdGenerator renamed to DefaultSessionIdGenerator
    • Storage renamed to SessionStorage; implementations LocalStorage and RedisStorage renamed to LocalSessionStorage and RedisSessionStorage
  • Driver renamed to SessionFactory

2.0.0

14 May 15:53
v2.0.0
2713af6

Choose a tag to compare

Changes from 2.0.0 Beta 4

  • Removed the Serializer interface and implementations in favor of using those in amphp/seraliziation

2.0.0 RC4

08 Oct 21:50

Choose a tag to compare

2.0.0 RC4 Pre-release
Pre-release

Note: This is a pre-release, there might be breaking changes in the final stable version.

  • Added Session::unlockAll() that completely unlocks a session, no matter how many times it has been locked (opened).
  • SessionMiddleware adds a callback using Response::onDispose() to call Session::unlockAll(). If the session is locked, this maintains the lock until the response is written or discarded.
  • Removed a circular reference in Session that prevented session locks from being released automatically.

2.0.0 RC3

08 Oct 15:07

Choose a tag to compare

2.0.0 RC3 Pre-release
Pre-release

Note: This is a pre-release, there might be breaking changes in the final stable version.

  • Added Driver class to collect the various components necessary for session creation. The class has a single method, create() that returns a Session instance.
  • The Storage interface has been reduced to only methods to store session data. Locking/unlocking is now handled by an instance of KeyedMutex given to Driver.
  • SessionMiddleware constructor now requires an instance of Driver instead of Storage.
  • RedisStorage constructor no longer needs an instance of Amp\Redis\Mutex\Mutex or IdGenerator.
  • InMemoryStorage constructor no longer needs an instance of IdGenerator.

2.0.0 RC2

16 Sep 17:34
e4d4f49

Choose a tag to compare

2.0.0 RC2 Pre-release
Pre-release
  • Session ID generation has been separated from storage implementations into a new interface IdGenerator and a default implementation DefaultIdGenerator.
  • The TTL parameter has been moved to the first parameter of InMemoryStorage and the third parameter RedisStorage constructors.
  • The first parameter of RedisStorage is now an instance of Amp\Redis\QueryExecutorFactory instead of Amp\Redis\Redis.
  • The session cookie is always set on each response to extend the session lifetime.
  • Fixed a bug where the cache-control header was not set after destroying the session.

2.0.0 RC1

12 Sep 16:42
122c18f

Choose a tag to compare

2.0.0 RC1 Pre-release
Pre-release

This release provides compatibility with amphp/redis@v1.

Note: This is a pre-release, there might be breaking changes in the final stable version.

Some BC breaks were required for compatibility in RedisStorage.

  • RedisStorage constructor now requires an instance of Amp\Redis\Redis and Amp\Redis\Mutex\Mutex.
  • RedisStorage::getClient() now returns an instance of Amp\Redis\Redis.

The rest of the API remains unchanged, so only changes to Redis storage initialization should be required when upgrading from v1.x.