python session set cookies 1

python session set cookies

import requests
s = requests.session()
s.cookies.set("COOKIE_NAME", "the cookie works", domain="example.com")
# Domain is optinal

Here is what the above code is Doing:
1. Create a session object
2. Set a cookie on the session object
3. Send the request

Similar Posts