-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dont_merge_cookies docs are incomplete #2998
Comments
You think that this is a change only related to the docs? Maybe we should add a new option called |
I mean that if i set def process_request(self, request, spider):
if request.meta.get('dont_merge_cookies', False):
return
cookiejarkey = request.meta.get("cookiejar")
jar = self.jars[cookiejarkey]
cookies = self._get_request_cookies(jar, request)
for cookie in cookies:
jar.set_cookie_if_ok(cookie, request)
# set Cookie header
request.headers.pop('Cookie', None)
jar.add_cookie_header(request)
self._debug_cookie(request, spider)
def process_response(self, request, response, spider):
if request.meta.get('dont_merge_cookies', False):
return response
# extract cookies from Set-Cookie and drop invalid/expired cookies
cookiejarkey = request.meta.get("cookiejar")
jar = self.jars[cookiejarkey]
jar.extract_cookies(response, request)
self._debug_set_cookie(response, spider)
return response if I set in issue2124 def process_request(self, request, spider):
cookiejarkey = request.meta.get("cookiejar")
jar = self.jars[cookiejarkey]
if request.meta.get('dont_merge_cookies', False):
jar = CookieJar()
cookies = self._get_request_cookies(jar, request)
for cookie in cookies:
jar.set_cookie_if_ok(cookie, request)
# set Cookie header
request.headers.pop('Cookie', None)
jar.add_cookie_header(request)
self._debug_cookie(request, spider) it can work in right way. And my English is so poor,sorry,,, |
dont_merge_cookies docs are incomplete: they say that
But this flag not only prevents merging of cookies, but also prevents sending of them:
scrapy/scrapy/downloadermiddlewares/cookies.py
Line 27 in b8870ee
Maybe a separate issue, but it'd be nice to have separate flags for sending and merging of cookies.
//cc @whalebot-helmsman
The text was updated successfully, but these errors were encountered: