We should cleanup unused cookies when switching between chunked and unchunked #303
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.
Description
If the size of the session grows from <4096 Bytes to >4096 Bytes, the middleware will create new
appSession.0
...,appSession.n
chunked cookies.But it will not remove the orginal single
appSession
, and since the cookie-store prefersappSession
, it will continue to read the stale single cookie rather than the updated chunked cookies.References
fixes #289
Testing
Login with small session (eg. database user with no custom claims)
Observe that you have a single
appSession
cookieHit some middleware that adds a large value to your session (making the session > 4096 Bytes)
Observe that you have new
appSession.0
andappSession.1
cookies - you should not have theappSession
cookieYou should be able to read the value of the new property on subsequent requests
This change adds test coverage for new/changed/fixed functionality
Checklist
main