Django logout(redirect to home page) .. Delete cookie?

Like jobscry said, logout() cleans session data, but it looks like you have set your own cookies too.

You could wrap auth logout view, which will return an HttpResponse:

def logout_user(request):
     response = logout(request, next_page=reverse('app.home.views.home'))
     response.delete_cookie('user_location')
     return response

Or if you're just using the logout method as opposed to the view, you can use the return value for the redirect() method you have [which I assume returns an HttpResponse too].

def logout_user(request):
     logout(request)
     response = redirect('app.home.views.home')
     response.delete_cookie('user_location')
     return response

Tags:

Cookies

Django