Skip to content

Method to delete a specific set of cookies #4942

Closed
@Lonami

Description

Currently if one wants to delete some cookies, the way to do it is not really obvious:

new_cookies = []

for c in session.cookie_jar:
    if check(c):
        c['max-age'] = -1
        new_cookies.append((c.key, c))

session.cookie_jar.update_cookies(new_cookies)

It would be nice to have a method to do this cleanly.

Use case: one may want to clear the cookies from a session before trying again the same operation but not wishing to recreate the session (or being unable to do so).

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions