Skip to content

Conversation

@manikyarathore
Copy link
Contributor

Fixes Issue #658 where cookies with leading dot domains (e.g., .example.com) in cookies.txt were ignored.
The loader stored the domain exactly as provided, but cookie lookup normalizes domains by removing the leading dot. This mismatch caused affected cookies to never match any host.

This PR normalizes the domain during loading:

String domain = tokens[0];
if (domain.startsWith(".")) {
    domain = domain.substring(1);
}
cookie.setDomain(domain);

Result
.example.com → example.com
Cookies load and match correctly.
No other behavior is affected.

@ato ato merged commit c46f3dd into internetarchive:master Nov 25, 2025
3 checks passed
@ato ato linked an issue Nov 25, 2025 that may be closed by this pull request
@ato
Copy link
Collaborator

ato commented Nov 25, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cookies with leading dot (.example.com) are ignored

2 participants