Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to fides_consent cookie for root domains with second-level domains (co.uk, co.jp, etc.) #2072

Closed
NevilleS opened this issue Dec 17, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@NevilleS
Copy link
Contributor

NevilleS commented Dec 17, 2022

Bug Description

We currently automatically detect the root domain of the site by parsing the hostname and extracting the last two parts (e.g. "some.privacy.example.com" -> "example.com").

However, some websites will have a root domain with three parts, like "example.co.uk", so this existing automatic detection will fail and will attempt to set the cookie to "co.uk" instead!

Steps to Reproduce

n/a - this is easy to understand in the code, but actually hard to reproduce "in the wild" as we'd need to deploy to a website with this style of domain.

Expected behavior

We should either:

  1. Automatically detect these types of "known" multi-level root domains
  2. Provide a configuration option to override what the cookie domain should be

I'm partial to option 2 as it feels like a safer choice and gives the user control over this behaviour.

@NevilleS
Copy link
Contributor Author

Note that some googling led me to https://github.com/peerigon/parse-domain, which confirmed that automatically parsing out the "effective TLD" is full of edge cases...!

@rsilvery
Copy link
Contributor

@allisonking or @NevilleS do we still need to handle this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants