Skip to content

Commit

Permalink
Fixes #1740: Delete session_key cookie on logout
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Dec 5, 2017
1 parent de2a894 commit cf49891
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion netbox/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ def post(self, request):
class LogoutView(View):

def get(self, request):

# Log out the user
auth_logout(request)
messages.info(request, "You have logged out.")

return HttpResponseRedirect(reverse('home'))
# Delete session key cookie (if set) upon logout
response = HttpResponseRedirect(reverse('home'))
response.delete_cookie('session_key')

return response


#
Expand Down

0 comments on commit cf49891

Please sign in to comment.