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
This is regarding Issue #2019
It adds persistent session features, and also the option for refreshing the current session before it expires while it's still valid (refresh window) and if it's beyond that window the session is invalid.
The default behavior without the new features should also remain the same was it was prior to the changes, every single requests results in a new session cookie.
I feel like there's possibly a much better way of doing this like being able to handle it all with in the call before the send_wrapper. However this is my first time delving into the ASGI framework so I'm not sure if I am able to obtain the new session data and compare it to the old session data only within the call and not have to make one cookie in call and another one with in send_wraper to resolve the current cookie and compare it to the new data.
Haven't added any tests to test_session.py yet, since I think this is a pretty large change and I can go ahead and work on that if this appears to be something that maybe accepted. The existing test suite passes however, and manually testing individual behaviors from the update work as expected.
There's no single change here, its a pretty big overall change to the middleware.
Checklist