1👍
According to the documentation:
New in Django 1.7.
Allows a user’s sessions to be invalidated when their password changes. See Session invalidation on password change for details. This middleware must appear after
django.contrib.auth.middleware.AuthenticationMiddleware
inMIDDLEWARE_CLASSES
.
Thus, my guess is that you are not on Django 1.7+, yet you have defined the django.contrib.auth.middleware.SessionAuthenticationMiddleware
in the MIDDLEWARE_CLASSES
.
<= Django 1.6
See the Sessions Documentation.
To enable session functionality, do the following:
Edit the
MIDDLEWARE_CLASSES
setting and make sure it contains'django.contrib.sessions.middleware.SessionMiddleware'
. The default settings.py created by django-admin.py startproject has SessionMiddleware activated.If you don’t want to use sessions, you might as well remove the SessionMiddleware line from
MIDDLEWARE_CLASSES
and'django.contrib.sessions'
from yourINSTALLED_APPS
. It’ll save you a small bit of overhead.