From c26a9015ad2f1f50e0dfc1510e9551414da0d04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 19 Sep 2019 11:08:06 +0200 Subject: [PATCH] Clarify the effects of dont_merge_cookies --- docs/topics/request-response.rst | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/topics/request-response.rst b/docs/topics/request-response.rst index ad1b9af10..284d3479b 100644 --- a/docs/topics/request-response.rst +++ b/docs/topics/request-response.rst @@ -83,17 +83,21 @@ Request objects .. reqmeta:: dont_merge_cookies When some site returns cookies (in a response) those are stored in the - cookies for that domain and will be sent again in future requests. That's - the typical behaviour of any regular web browser. However, if, for some - reason, you want to avoid merging with existing cookies you can instruct - Scrapy to do so by setting the ``dont_merge_cookies`` key to True in the - :attr:`Request.meta`. + cookies for that domain and will be sent again in future requests. + That's the typical behaviour of any regular web browser. - Example of request without merging cookies:: + To create a request that does not send stored cookies and does not + store received cookies, set the ``dont_merge_cookies`` key to ``True`` + in :attr:`request.meta `. - request_with_cookies = Request(url="http://www.example.com", - cookies={'currency': 'USD', 'country': 'UY'}, - meta={'dont_merge_cookies': True}) + Example of a request that sends manually-defined cookies and ignores + cookie storage:: + + Request( + url="http://www.example.com", + cookies={'currency': 'USD', 'country': 'UY'}, + meta={'dont_merge_cookies': True}, + ) For more info see :ref:`cookies-mw`. :type cookies: dict or list