Here is the problem I am facing with the Django Authenetication
Any ideas how to solve the problem?
MY Django Session Settings are
SESSION_EXPIRE_AT_BROWSER_CLOSE = True SESSION_COOKIE_AGE = 3600
Thanks, Sujit
Basically, this should work:
from django.contrib.auth import logout
def logout_view(request):
logout(request)
# Redirect to a success page.
Could you clarify by posting your view if it's not something like this?
In Django 1.4.* I've had problems with the logout()
function. It simply wasn't logging out my users.
Now I'm just using the contributed view to logout users and it works perfectly. Simply add this to your root urls.py
file if you don't want to do anything else special:
(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/login'}),
and you'll be good to go.
Happy Djangoing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With