dgtlmoon / dgtlmoon/changedetection.io
'Cookie:' header dissapears on redirect
- Dominant language
- Python
- Stars
- 34.1k
- Forks
- 2k
- Avg merge
- 22h 52m
- Merged PRs (30d)
- 70
Description
**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:

But instead they're missing:

**Screenshots**


**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)
Contributor guide
Assessment
This issue has not been assessed yet.