Releases: amphp/http-server-session
3.0.1
3.0.0
This release is compatible with amphp/http-server@^3.
- Renamed
Storage,InMemoryStorage,RedisStorage,DefaultIdGenerator, andDrivertoSessionStorage,LocalSessionStorage,RedisSessionStorage,Base64UrlSessionIdGenerator, andSessionFactory, respectively - Renamed methods on
Session:open()tolock(),save()tocommit() - Added
Session::rollback()to undo local changes and re-read the session data from storage - Added
SessionTrainerfor examining session changes unit testing
3.0.0 Beta 2
- Compatibility with
amphp/http@v2
2.0.1
3.0.0 Beta 1
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
Sessionprefix to interfaces:IdGeneratorrenamed toSessionIdGenerator; implementationDefaultIdGeneratorrenamed toDefaultSessionIdGeneratorStoragerenamed toSessionStorage; implementationsLocalStorageandRedisStoragerenamed toLocalSessionStorageandRedisSessionStorage
Driverrenamed toSessionFactory
2.0.0
2.0.0 RC4
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). SessionMiddlewareadds a callback usingResponse::onDispose()to callSession::unlockAll(). If the session is locked, this maintains the lock until the response is written or discarded.- Removed a circular reference in
Sessionthat prevented session locks from being released automatically.
2.0.0 RC3
Note: This is a pre-release, there might be breaking changes in the final stable version.
- Added
Driverclass to collect the various components necessary for session creation. The class has a single method,create()that returns aSessioninstance. - The
Storageinterface has been reduced to only methods to store session data. Locking/unlocking is now handled by an instance ofKeyedMutexgiven toDriver. SessionMiddlewareconstructor now requires an instance ofDriverinstead ofStorage.RedisStorageconstructor no longer needs an instance ofAmp\Redis\Mutex\MutexorIdGenerator.InMemoryStorageconstructor no longer needs an instance ofIdGenerator.
2.0.0 RC2
- Session ID generation has been separated from storage implementations into a new interface
IdGeneratorand a default implementationDefaultIdGenerator. - The TTL parameter has been moved to the first parameter of
InMemoryStorageand the third parameterRedisStorageconstructors. - The first parameter of
RedisStorageis now an instance ofAmp\Redis\QueryExecutorFactoryinstead ofAmp\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
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.
RedisStorageconstructor now requires an instance ofAmp\Redis\RedisandAmp\Redis\Mutex\Mutex.RedisStorage::getClient()now returns an instance ofAmp\Redis\Redis.
The rest of the API remains unchanged, so only changes to Redis storage initialization should be required when upgrading from v1.x.