Skip to content

feat(http-clients)!: Merge a Cookie header with stored cookies - #2385

Merged
vdusek merged 1 commit into
apify:v2from
Mantisus:cookie-header-merge
Nov 3, 2026
Merged

vdusek merged 1 commit into
apify:v2from
Mantisus:cookie-header-merge

Conversation

@Mantisus

@Mantisus Mantisus commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Description

A Cookie header passed with a request or set on the client is now merged with the session cookies, with every HTTP client and in context.send_request of PlaywrightCrawler. A cookie in the header wins over a session cookie of the same name and isn't stored in the session. An empty Cookie header no longer keeps the session cookies out. The v2 upgrade guide describes the change.

Issues

✍️ Drafted by Claude Code

Co-authored-by: Vlada Dusek <v.dusek96@gmail.com>
@Mantisus
Mantisus requested a review from vdusek November 2, 2026 15:22
@Mantisus Mantisus self-assigned this Nov 2, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Nov 2, 2026
@vdusek vdusek linked an issue Nov 3, 2026 that may be closed by this pull request
@vdusek
vdusek merged commit 0f1ee2a into apify:v2 Nov 3, 2026
36 checks passed
vdusek added a commit that referenced this pull request Nov 3, 2026
### Description

`HttpClient.send_request` and `context.send_request` take a new
`cookies` argument, the cookies to send and store instead of the session
cookies for a single call. To send no session cookies, pass
`cookies=SessionCookies()`. In `PlaywrightCrawler`, they're sent instead
of the browser context cookies, and the response cookies still reach the
session through the browser context.

### Issues

- Part of: #2307
- Follow-up: #2385

*✍️ Drafted by Claude Code*

---------

Co-authored-by: Vlada Dusek <v.dusek96@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move redirect and cookie handling into a shared HttpClient base class

2 participants