alexapy.aiohttp.cookiejar

Classes

class alexapy.aiohttp.cookiejar.CookieJar(*, unsafe: bool = False, quote_cookie: bool = True, treat_as_secure_origin: Optional[Union[str, yarl.URL, List[Union[str, yarl.URL]]]] = None, loop: Optional[asyncio.events.AbstractEventLoop] = None)

Implements cookie storage adhering to RFC 6265.

Inheritance

Inheritance diagram of CookieJar

clear(predicate: Optional[Callable[[Morsel[str]], bool]] = None) None

Clear all cookies if no predicate is passed.

clear_domain(domain: str) None

Clear all cookies for domain and all subdomains.

filter_cookies(request_url: yarl.URL = URL('')) Union[BaseCookie[str], SimpleCookie[str]]

Returns this jar’s cookies filtered by their attributes.

update_cookies(cookies: Union[Mapping[str, Union[str, BaseCookie[str], Morsel[Any]]], Iterable[Tuple[str, Union[str, BaseCookie[str], Morsel[Any]]]], BaseCookie[str]], response_url: yarl.URL = URL('')) None

Update cookies.

class alexapy.aiohttp.cookiejar.DummyCookieJar(*, loop: Optional[asyncio.events.AbstractEventLoop] = None)

Implements a dummy cookie storage.

It can be used with the ClientSession when no cookie processing is needed.

Inheritance

Inheritance diagram of DummyCookieJar

clear(predicate: Optional[Callable[[Morsel[str]], bool]] = None) None

Clear all cookies if no predicate is passed.

clear_domain(domain: str) None

Clear all cookies for domain and all subdomains.

filter_cookies(request_url: yarl.URL) BaseCookie[str]

Return the jar’s cookies filtered by their attributes.

update_cookies(cookies: Union[Mapping[str, Union[str, BaseCookie[str], Morsel[Any]]], Iterable[Tuple[str, Union[str, BaseCookie[str], Morsel[Any]]]], BaseCookie[str]], response_url: yarl.URL = URL('')) None

Update cookies.