-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let SessionMiddleware handle session saving #2863
Comments
An actual difference between calling save early and not: |
And it seems, depending on what subclass of The one we use, |
branch: save-in-middleware in my fork is a WIP attempt at this |
big problem i had: get session middleware to run properly during testing |
Related to #2804
Django lets SessionMiddleware save session during the response processing step. Saving on login was already done some places, but #2813 made it happen for all kinds of logins. Similarly some places save session after logging out, and #2828 makes it happen on all logouts.
Basically the save calls in
clear_session
andset_account
should be removed. This does however cause at least 1 test to break, since it uses the Django test client from theclient
fixture, and the SessionMiddleware does not seem to run automatically during requests made usingclient
.The text was updated successfully, but these errors were encountered: