Skip to content

Client-level cookies override request cookies #2055

@alexeyzimarev

Description

@alexeyzimarev

When client-level CookieContainer got back to the options, the code to add cookie headers changed. It adds the cookie header from request cookies, and then adds the cookie header from the client-level container.

Because headers is a dictionary, adding the Set-Cookie header for the second time results in overriding it. As a result, if the client-level cookie container has cookies, it overrides request-level cookies.

To fix this, the code that adds the cookie header needs to check if any Set-Cookie header is already present in the headers collection, and combine both if that's the case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions