2

Django allows a user to be logged in from multiple computers, in different sessions. Is there a way to limit user from logging from multiple machines at the same time. That is if there's a live session with the user logged in on a browser or a computer, you must not allow him to login at another computer.

This would be a useful hack, for security purpose. Do advise

ramdaz
  • 1,761
  • 1
  • 20
  • 43
  • This isssue was covered at http://stackoverflow.com/questions/821870/how-can-i-detect-multiple-logins-into-a-django-web-application-from-different-lo and http://stackoverflow.com/questions/953879/how-to-force-user-logout-in-django – Chewie May 14 '12 at 17:57

1 Answers1

0

You will want to use Django Sessions in your login view. Depending on how you set up the login view you might want to query your Sessions object and filter as well and then compare datetime.now() vs NameOfQuerySessionVariable.expire_date

Frantz Romain
  • 836
  • 1
  • 6
  • 14