changedetection.io icon indicating copy to clipboard operation
changedetection.io copied to clipboard

'Cookie:' header dissapears on redirect

Open Tschrock opened this issue 5 months ago • 2 comments

Describe the bug Had a watch start failing recently due to being logged out. The only change was the page now redirects to a different page. I double checked the request in mitmproxy and the original request includes my cookie header, but the request following the redirect doesn't have the cookie header.

Version v0.50.5

How did you install? docker compose

To Reproduce

Steps to reproduce the behavior:

  1. Create a watch
    • Url: https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org/cookies
    • Fetch method: 'Basic fast Plaintext/HTTP Client'
    • Advanced options -> Request headers: Cookie: examplecookie=3

Expected behavior Cookie header is sent with both the initial request and redirected request

I'd expect to see my cookies:

Image

But instead they're missing:

Image

Screenshots

Image

Image

Additional context Dug in a bit and found that requests drops manually-set cookie headers when following a redirect in a session (https://github.com/psf/requests/blob/91a3eabd3dcc4d7f36dd8249e4777a90ef9b4305/src/requests/sessions.py#L235) It doesn't look like they're interested in changing that behavior (https://github.com/psf/requests/issues/5714)

Tschrock avatar Jul 02 '25 15:07 Tschrock

thanks for the report and digging around, so i'm not sure what we can do here if requests drops it on redirect?

dgtlmoon avatar Jul 02 '25 15:07 dgtlmoon

just tested it on Playwright and confirmed that the same issue occurs

kingwkb avatar Nov 16 '25 06:11 kingwkb