Opened 13 years ago
Last modified 8 years ago
#17975 new Cleanup/optimization
Make sessions more robust
Reported by: | Paul McMillan | Owned by: | nobody |
---|---|---|---|
Component: | contrib.sessions | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Pull Requests: | How to create a pull request | ||
Description ¶
In #17810, we fixed a specific problem where an invalid session cookie could result in a server error. Since this has the effect of locking a user out of an application permanently (the site just appears broken) until they clear their cookies, this is pretty undesirable.
This ticket is to improve and expand that protection. We should change the contract around sessions to be more robust. I suggest something along the lines of "if there is any kind of error during any operation related to a session, we log the problem and push a brand new session to the user."
This will mean that cases where an invalid session can exist (as in the previous ticket by an overly long session key, or one could imagine situations with broken pickled session data) don't wedge the user experience. We should (carefully) extend the protection added there to cover sessions more generally, including session creation, deletion, and access, across all backends. This will, of course, need to be balanced with providing useful error messages to developers.
According to the ticket's flags, the next step(s) to move this issue forward are:
- To provide a patch by sending a pull request. Claim the ticket when you start working so that someone else doesn't duplicate effort. Before sending a pull request, review your work against the patch review checklist. Check the "Has patch" flag on the ticket after sending a pull request and include a link to the pull request in the ticket comment when making that update. The usual format is:
[https://github.com/django/django/pull/#### PR]
.