Most optimized way to delete all sessions for a specific user in Django?

后端 未结 5 1324
感动是毒
感动是毒 2021-02-01 18:40

I\'m running Django 1.3, using Sessions Middleware and Auth Middleware:

# settings.py

SESSION_ENGINE = django.contrib.sessions.backends.db   # Persist sessions          


        
5条回答
  •  梦如初夏
    2021-02-01 19:05

    It might be helpful to use:

    • django-password-session in order to invalidate user's sessions after a password is changed. Since Django 1.7 this feature implemented out of the box.
    • django-admin clearsessions to remove expired cookies

提交回复
热议问题