Join GitHub today
something strange about cookie in requests.session. #5154
follow all 'set-cookie' actions from website.
the website i request would set cookie for three or times to change a specific cookie or add a new cookie. and i found that first time the website set three cookies, that's ok, second time the website set another three cookies, and it failed, and third time the website tried to change three cookies, and it failed too.
import requests session = requests.session() session.get(url1) session.get(url2) session.get(url3)
This command is only available on Requests v2.16.4 and greater. Otherwise,
forget to say how i solve it temporarily..cause i found that 'session.cookies' is ok, but cookies in http packets that i captured did not match session.cookie, i tried to change cookieJar to a DICT and then change this DICT to cookieJar, and assign session.cookies with the new cookieJar before every http request.