get_cookie

The command to get the cookie with the given name.

Syntax

py.get_cookie(name: str) -> dict

Usage

correct usage
py.get_cookie("foo")

---or--- # "key" into the dictionary

val = py.get_cookie("foo")["value"]

---or--- # use the .get() function in dict

val = py.get_cookie("foo").get("value")

Arguments

  • name (str) - The name of the cookie

Yields

  • Dict - The cookie as a dictionary. Cookie objects have the following properties:

    • name

    • value

    • path

    • domain

    • httpOnly

    • secure

    • expiry

Returns None if the cookie does not exist

Last updated