0

On a system I have developed It requires me to login using a standard and simple username and password combination.

The system I use is Django does anyone know how I can kill this session so that when a user presses log off it invokes the login screen again.

Cheers,

TheMonkeyMan
  • 8,622
  • 8
  • 27
  • 42
  • 1
    Seems to me like you need to redirect your view when logging out, anyway: if you use django-auth system, the session is killed when you logoff the user. – Jingo Jan 31 '12 at 16:28
  • Duplicate? Good answer over here http://stackoverflow.com/questions/953879/how-to-force-user-logout-in-django/954318#954318 – istruble Jan 31 '12 at 16:50

1 Answers1

1

If you are using the default authentication system django.contrib.auth, you simply need to create a view that calls django.contrib.auth.logout() and wire a url to it.

Luckily, the auth app already has a view that does this, so you simply need to redirect the user to

/logout/
istruble
  • 13,363
  • 2
  • 47
  • 52
Timmy O'Mahony
  • 53,000
  • 18
  • 155
  • 177