Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.
This repository was 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

Description

@pedroflying

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions