Home / Function/ get_cookie_domain() — flask Function Reference

get_cookie_domain() — flask Function Reference

Architecture documentation for the get_cookie_domain() function in sessions.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  522c0d60_ef75_10cc_88d3_4d9ccebd6a54["get_cookie_domain()"]
  bbf56873_bd71_6e70_f44c_ca8a85b0a007["SessionInterface"]
  522c0d60_ef75_10cc_88d3_4d9ccebd6a54 -->|defined in| bbf56873_bd71_6e70_f44c_ca8a85b0a007
  58643c3f_4184_c18b_8361_a7d628d93359["save_session()"]
  58643c3f_4184_c18b_8361_a7d628d93359 -->|calls| 522c0d60_ef75_10cc_88d3_4d9ccebd6a54
  style 522c0d60_ef75_10cc_88d3_4d9ccebd6a54 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/sessions.py lines 189–199

    def get_cookie_domain(self, app: Flask) -> str | None:
        """The value of the ``Domain`` parameter on the session cookie. If not set,
        browsers will only send the cookie to the exact domain it was set from.
        Otherwise, they will send it to any subdomain of the given value as well.

        Uses the :data:`SESSION_COOKIE_DOMAIN` config.

        .. versionchanged:: 2.3
            Not set by default, does not fall back to ``SERVER_NAME``.
        """
        return app.config["SESSION_COOKIE_DOMAIN"]  # type: ignore[no-any-return]

Subdomains

Called By

Frequently Asked Questions

What does get_cookie_domain() do?
get_cookie_domain() is a function in the flask codebase, defined in src/flask/sessions.py.
Where is get_cookie_domain() defined?
get_cookie_domain() is defined in src/flask/sessions.py at line 189.
What calls get_cookie_domain()?
get_cookie_domain() is called by 1 function(s): save_session.

Analyze Your Own Codebase

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

Try Supermodel Free