Also remove old domain-less api token cookie on logout, for existing sessions

This commit is contained in:
Mathieu Pillard 2018-01-25 12:33:59 +01:00
Родитель 0850b4c071
Коммит 622c0f2d08
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -325,6 +325,11 @@ class AuthenticateView(FxAConfigMixin, APIView):
def logout_user(request, response):
logout(request)
# The API_TOKEN_COOKIE needs to be deleted twice, one with specifying
# the domain, and one without. This is because it used to be set without
# the domain, so we still have users around with that version of the
# cookie.
response.delete_cookie(API_TOKEN_COOKIE)
response.delete_cookie(
API_TOKEN_COOKIE, domain=settings.SESSION_COOKIE_DOMAIN)