Skip to content

common_browser.contracts.cookies

Browser cookie vocabulary, preserving scope and protecting its value.

Classes

Bases: BaseModel

Cookie identity is name/domain/path/partition, never name alone.

The URL convenience normalizes into browser scope at construction. Its directory becomes the path and HTTPS supplies the secure flag, matching Playwright’s cookie boundary; explicit domain/path input stays explicit.

Fields and properties declared here; inherited members belong to the bases above.

domain

domain: str | None = None

expires

expires: float | None = Field(default=None, allow_inf_nan=False, le=253402300799)

http_only

http_only: bool = Field(default=False, alias='httpOnly')

key

Read-only property.

key: tuple[str, str, str, str | None]

name

name: str = Field(min_length=1)

partition_key

partition_key: str | None = Field(default=None, alias='partitionKey', repr=False)

path

path: str = '/'

same_site

same_site: Literal['Strict', 'Lax', 'None'] = Field(default='Lax', alias='sameSite')

secure

secure: bool = False

url

url: str | None = Field(default=None, repr=False)

value

value: SecretStr = Field(repr=False)

export

def export() -> dict[str, Any]

Explicitly reveal a copy for the browser’s cookie boundary.