feat(session): add CacheSessionStorage driver#395
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #395 +/- ##
============================================
+ Coverage 83.67% 83.72% +0.04%
- Complexity 3067 3077 +10
============================================
Files 103 104 +1
Lines 9018 9045 +27
============================================
+ Hits 7546 7573 +27
Misses 1472 1472
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Adapter that implements SessionStorage using the cache library's Storage interface. Supports any cache backend (Redis, file, etc.). - Configurable key prefix for namespace isolation - Configurable TTL (default: 7200s) - Cache-level encryption disabled (sessions have their own) - 100% test coverage (11 tests, 18/18 lines) Closes #337
46f626d to
2496203
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Add a cache-backed session storage driver that delegates to the cache library's
Storageinterface.Motivation
Sessions were limited to file or database storage. Production deployments need Redis-backed sessions for horizontal scaling. The cache library already ships with
RedisStorage— this adapter bridges it to the session layer.Changes
WebFiori\Framework\Session\CacheSessionStorageSessionStorageby delegating to anyWebFiori\Cache\StoragebackendHow to Test / Verify
11 unit tests with 100% line coverage. Run:
Usage
Breaking Changes and Migration Steps
None.
Checklist
Related issues
Closes #337