Fixed #1711
authordaftshady <daftonshady@gmail.com>
Tue, 29 Oct 2013 14:18:03 +0000 (23:18 +0900)
committerdaftshady <daftonshady@gmail.com>
Tue, 26 Nov 2013 06:22:46 +0000 (15:22 +0900)
requests/sessions.py

index 9c95b58..a5cb897 100644 (file)
@@ -330,7 +330,11 @@ class Session(SessionRedirectMixin):
         prep = self.prepare_request(req)
 
         # Add param cookies to session cookies
-        self.cookies = cookiejar_from_dict(cookies, cookiejar=self.cookies, overwrite=False)
+        if isinstance(cookies, dict):
+            self.cookies = cookiejar_from_dict(
+                cookies, cookiejar=self.cookies, overwrite=False)
+        elif isinstance(cookies, cookielib.CookieJar):
+            self.cookies.update(cookies)
 
         proxies = proxies or {}