Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Cookie not removed in request when response is 401 #493

Open
pedroflying opened this issue Feb 11, 2020 · 0 comments
Open

Cookie not removed in request when response is 401 #493

pedroflying opened this issue Feb 11, 2020 · 0 comments

Comments

@pedroflying
Copy link

I'm using JWT in a httpOnly cookie and allowing multiple logins on the system.
If I have 2 sessions opened with the same user (different JWT tokens) and if one of them logs out I reset all JWT tokens by changing the user's UUID. I also delete that session's cookie by means of:

        response = HttpResponse()
        response.delete_cookie("cookie.jwt",path="/")

This logs out both browser sessions and that's OK, but the browser session in which I DID NOT explicitly log out keeps an invalid cookie in the browser and I can't get rid of it via javascript because its httpOnly (I want it to stay that way). All further requests to the server return as a 401 and I can't seem to change the response to add a "delete_cookie".

Two questions:

  1. Why not always delete the cookie JWT_AUTH_COOKIE from the response if an exception is raised by JWT?

  2. How can I work around this issue?

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant