Skip to content

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

@antonfirsov

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 :(

Metadata

Metadata

Assignees

Labels

area-System.Netin-prThere is an active PR which will close this issue when it is merged

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions