tinesoft/ngx-cookieconsent

Multi Domain Support

rajeshkumaryadavdotcom opened this issue · 1 comments

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request

CookieConsent and Library Versions?

- cookieconsent version:
- ngx-cookieconsent version:

OS Version?

Angular, Node and al Versions?

Repro steps

The log given by the failure

Desired functionality

Mention any other details that might be useful

I have two domains rajeshyadav.net and rajeshkumaryadav.com in the domain I set .com site which works fine but when I open .net site I click got it and refresh page again it shows, can we pass two domains ?

Hi,

Please see #36, as this is a duplicate of it.

Besides, if you have 2 different domains, so I guess 2 different deployments, maybe you can use 2 Angular's environment.ts to variabilize the domain in prod:

src/environment.ts
{
   cookieDomain: localhost
}
src/environment.prod1.ts
{
   cookieDomain: rajeshyadav.net
}

And

src/environment.prod2.ts
{
   cookieDomain: rajehyadav.com
}

In your AppModule, you will import that environment.ts file and use environment.cookieDomain to set the domain on the NgcCookieConsentConfig object.

Then when you build/ deploy:

  • ng build --prod1 for domain1
  • ng build --prod2 for domain2