Set a cookie, without checking whether or not it should be set.
(self, cookie)
| 1666 | self._cookies_lock.release() |
| 1667 | |
| 1668 | def set_cookie(self, cookie): |
| 1669 | """Set a cookie, without checking whether or not it should be set.""" |
| 1670 | c = self._cookies |
| 1671 | self._cookies_lock.acquire() |
| 1672 | try: |
| 1673 | if cookie.domain not in c: c[cookie.domain] = {} |
| 1674 | c2 = c[cookie.domain] |
| 1675 | if cookie.path not in c2: c2[cookie.path] = {} |
| 1676 | c3 = c2[cookie.path] |
| 1677 | c3[cookie.name] = cookie |
| 1678 | finally: |
| 1679 | self._cookies_lock.release() |
| 1680 | |
| 1681 | def extract_cookies(self, response, request): |
| 1682 | """Extract cookies from response, where allowable given the request.""" |