Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly delete cookies #53

Open
mglaman opened this issue Aug 19, 2024 · 1 comment
Open

Properly delete cookies #53

mglaman opened this issue Aug 19, 2024 · 1 comment

Comments

@mglaman
Copy link

mglaman commented Aug 19, 2024

Cookies are not removed if the server deletes them

Example:

"SESS61c42da5939b03e7ce094fcacb127d7a=deleted; expires=Thu, 01 Jan 1970 00:00:01 GMT; Max-Age=0; path=/; HttpOnly"

This should delete the cookie. Instead the CGI worker sets the value to deleted. Which kind of works, because the session isn't matched. But not entirely.

@mglaman
Copy link
Author

mglaman commented Aug 19, 2024

I'm working around with this a custom map. However, it doesn't handle the expiry time

class CookieMap extends Map {
    constructor(iterable) {
        super(iterable);
    }

    set(key, value) {
        console.table({ key, value })
        if (value === 'deleted') {
            super.delete(key)
        } else {
            super.set(key, value)
        }
    }
}

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

No branches or pull requests

1 participant