python - Adding cookies to a cookiejar -
python - Adding cookies to a cookiejar -
i'm playing around requests.session() i'm running few issues. know session supposed handle cookies me, i'm seeing in cases isn't saving cookie browser is. wanted see happen if manually added or modified cookies match browser wasn't sure how it.
<<class 'requests.cookies.requestscookiejar'>[<cookie bcookie="v=cookie" .domain.com/>....
i imagine need decode cookie string/dictionary, add/modify cookie , reencode it?
the session.cookies
object gives mapping interface; add together cookies, set value cookie name:
session.cookies['cookie_name'] = 'cookie_value'
and leave requests
.
in other direction, using session.cookies['cookie_name']
gives just value cookie, without need larn how python cookiejar
object works , tracks other per-cookie metadata (such host names , expiration information).
python cookies python-requests
Comments
Post a Comment