views:

61

answers:

1

Here is the problem I am facing with the Django Authenetication

  1. Access a page that requires a login.
  2. Logout (accessing django.contrib.auth.logout)
  3. Access the original login-protected page. You are still logged in

Any ideas how to solve the problem?

MY Django Session Settings are

SESSION_EXPIRE_AT_BROWSER_CLOSE = True SESSION_COOKIE_AGE = 3600

Thanks, Sujit

+1  A: 

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?

jbochi
Thanks for your reply.I have the exact code for logout mechanism. But still it doesn't logout
SystemMatrix