#28699: Document middleware ordering requirements following CSRF change in
Django
1.11.6
-------------------------------+------------------------------------
Reporter: stephanm | Owner: Rodrigo
Type: Bug | Status: assigned
Component: Documentation | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Comment (by Florian Apolloner):
Replying to [comment:16 Carlton Gibson]:
> Unless I missed something, this is **negating the `rotate_token()`
call**. Is that correct, or have I misread it? Given the docstring in
`rotate_token()` isn't this a no-no? If so, we can't recommend this.
Yes, this seems correct
> On the other hand, if `CsrfViewMiddleware` is first then the
`rotate_token()` call will replace whatever `CSRF_COOKIE` was previously
set, and so the actual CSRF check in `process_view()` will necessarily
fail. (As we must be seeing here.)
Also correct. I wonder if my patch in #28488 actually made the situation
worse (speaks for the complexity of the middleware :/)
--
Ticket URL: <https://code.djangoproject.com/ticket/28699#comment:18>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.b2f6490fb2cddaf50b2bc8b7cbbe0e4b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.