import json
cookies = session.get_cookies() # get the cookies from the session
with open("cookies.json", "w") as f:
    json.dump(cookies, f) # save the cookies to a json file

Returns

list[CookieDict]: The response containing the list of cookies in the session.

Raises

  • ValueError: If the session hasn’t been started yet (no session_id available).