Django: retrieve session or cookies in middleware
-
28-09-2019 - |
Question
can i get the current session or cookie inside a middleware?
I tried but I got:
'WSGIRequest' object has no attribute 'session'
Solution
This will work in any middleware that comes after django.contrib.sessions.middleware.SessionMiddleware
in settings.py.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow