Make sure to also delete any un-suffixed cookies when deleting a cookie

Follow-up to a161feb
This commit is contained in:
Gina Häußge 2016-10-06 15:25:13 +02:00
parent 6c21ee32a8
commit 41fe997af4

View file

@ -410,6 +410,14 @@ class OctoPrintFlaskResponse(flask.Response):
# add request specific cookie suffix to name
flask.Response.set_cookie(self, key + flask.request.cookie_suffix, *args, **kwargs)
def delete_cookie(self, key, path='/', domain=None):
flask.Response.delete_cookie(self, key, path=path, domain=domain)
# we also still might have a cookie left over from before we started prefixing, delete that manually
# without any pre processing (no path prefix, no key suffix)
flask.Response.set_cookie(self, key, expires=0, max_age=0, path=path, domain=domain)
#~~ passive login helper
def passive_login():