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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -