Skip to content

Cookie.GetHashCode() does not ignore leading dot in Domain #112602

Description

@antonfirsov

There was an overlook in #64038: we switched behavior to ignore leading dot in Cookie.Domain for equality comparison, but it still affects Cookie.GetHashCode() calculation.

Cookie a = new("a", "aa") { Domain = "wow" };
Cookie b = new("a", "aa") { Domain = ".wow" };
Console.WriteLine(a.Equals(b)); // True
Console.WriteLine(a.GetHashCode() == b.GetHashCode()); // False :(

Activity

  1. added this to the 10.0.0 milestone on Feb 15, 2025
  2. self-assigned this
    on Feb 15, 2025
  3. dotnet-policy-service commented on Feb 15, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/ncl
    See info in area-owners.md if you want to be subscribed.

  4. added
    in-pr
    on Feb 15, 2025
  5. locked and limited conversation to collaborators on Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-System.Netin-pr

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions