docs: Add cookies management guide - #2097
Open
Mantisus wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new “Cookie management” guide to the Python Crawlee docs, aimed at clarifying how cookies are stored on sessions and how to keep cookies/session state across retries (addressing #2060). It also cross-links the new guide from existing session, headers, and login documentation.
Changes:
- Added a new
Cookie managementguide covering reading/setting cookies, seeding cookies in new sessions, Playwright cookie syncing, retry patterns, and persistence across runs. - Added runnable Python code examples for the cookie guide (read/write, initial cookies, Playwright sync, retry strategies, persistence).
- Added references to the new cookie guide from existing guides (session management, HTTP headers, logging in).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/guides/session_management.mdx | Adds a cross-link to the new cookie guide from session management. |
| docs/guides/http_headers.mdx | Links cookie header discussion to the new cookie guide. |
| docs/guides/crawler_login.mdx | Links authentication/session guidance to the new cookie guide. |
| docs/guides/cookie_management.mdx | New guide documenting cookie behavior, retries, Playwright syncing, and persistence. |
| docs/guides/code_examples/cookie_management/read_write_cookies.py | Example for reading and setting session cookies. |
| docs/guides/code_examples/cookie_management/initial_cookies.py | Example for seeding cookies via create_session_settings. |
| docs/guides/code_examples/cookie_management/playwright_cookies.py | Example showing Playwright ↔ session cookie syncing behavior. |
| docs/guides/code_examples/cookie_management/retry_single_session.py | Example for preserving cookies across retries with a single-session pool. |
| docs/guides/code_examples/cookie_management/retry_pinned_session.py | Example for “retrying” by re-enqueueing a request pinned to a session. |
| docs/guides/code_examples/cookie_management/retry_restore_cookies.py | Example for restoring cookies via use_state + pre_navigation_hook. |
| docs/guides/code_examples/cookie_management/persist_cookies.py | Example for persisting cookies across runs via session pool persistence. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Mantisus
force-pushed
the
cookie-management
branch
from
July 28, 2026 21:51
21351a7 to
3ff1281
Compare
Mantisus
marked this pull request as ready for review
July 29, 2026 22:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Issues