Home / Function/ remove_cookie_by_name() — requests Function Reference

remove_cookie_by_name() — requests Function Reference

Architecture documentation for the remove_cookie_by_name() function in cookies.py from the requests codebase.

Entity Profile

Dependency Diagram

graph TD
  77ee6ec1_a3fe_db5e_fd67_5f7d14f25ff9["remove_cookie_by_name()"]
  270696ff_2a4f_ef5b_92e8_33a79e68a2d8["cookies.py"]
  77ee6ec1_a3fe_db5e_fd67_5f7d14f25ff9 -->|defined in| 270696ff_2a4f_ef5b_92e8_33a79e68a2d8
  fd64c32d_aaa4_5925_c2a7_12f040eb3704["set()"]
  fd64c32d_aaa4_5925_c2a7_12f040eb3704 -->|calls| 77ee6ec1_a3fe_db5e_fd67_5f7d14f25ff9
  0875bb69_5290_2e97_df25_565f599a5eba["__delitem__()"]
  0875bb69_5290_2e97_df25_565f599a5eba -->|calls| 77ee6ec1_a3fe_db5e_fd67_5f7d14f25ff9
  style 77ee6ec1_a3fe_db5e_fd67_5f7d14f25ff9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/requests/cookies.py lines 151–167

def remove_cookie_by_name(cookiejar, name, domain=None, path=None):
    """Unsets a cookie by name, by default over all domains and paths.

    Wraps CookieJar.clear(), is O(n).
    """
    clearables = []
    for cookie in cookiejar:
        if cookie.name != name:
            continue
        if domain is not None and domain != cookie.domain:
            continue
        if path is not None and path != cookie.path:
            continue
        clearables.append((cookie.domain, cookie.path, cookie.name))

    for domain, path, name in clearables:
        cookiejar.clear(domain, path, name)

Domain

Subdomains

Called By

Frequently Asked Questions

What does remove_cookie_by_name() do?
remove_cookie_by_name() is a function in the requests codebase, defined in src/requests/cookies.py.
Where is remove_cookie_by_name() defined?
remove_cookie_by_name() is defined in src/requests/cookies.py at line 151.
What calls remove_cookie_by_name()?
remove_cookie_by_name() is called by 2 function(s): __delitem__, set.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free