set_cookie

The command to set a cookie into the current browser session.

Syntax

py.set_cookie(cookie: dict) -> None

Usage

correct usage
py.set_cookie({"name" : "foo", "value" : "bar"})
incorrect usage
# Errors, 'set_cookie' accepts a single argument that is a Dict
py.set_cookie("foo", "bar")

---or---

# Errors, 'set_cookie' yields None
py.set_cookie({"name" : "foo", "value" : "bar"}).get_cookie()

Arguments

  • cookie (Dict) - A dictionary with required keys: "name" and "value"

Optional keys: "path", "domain", "secure", "expiry"

Yields

  • None

Last updated