2

I have a multisite configuration running SC8.2u2. All sites have a common domain name xxx.com, however the SC_ANALYTICS_GLOBAL_COOKIE domain name on sub-sites is set to the sub-domain accounts.xxx.com and legal.xxx.com so the global cookie does not match for users when they traverse to a different sub-site.

How is the domain name set for a given sub-site and is there a way to control it? And can I force all sites to use a common wildcard .xxx.com?

4

You'll want to set a <httpCookies> configuration in your Web.config that allows for a wildcard domain. This is done by specifying the root of your domain in the cookie.

Note: that by changing this cookie, this will require people to log back into Sitecore and may need cookies to be cleared in order to take effect. Test heavily to ensure it works for all of your use cases.

<configuration>
  <system.web>
    <httpCookies domain=".xxx.com" />
  </system.web>
</configuration>
  • Will this work also for the "main" domain www.xxx.com? – Snapper Jan 10 at 4:13
  • Yes, this will work for all *.xxx.com domains. – Pete Navarra Jan 10 at 6:23
  • What should you put if some of the sites have different TLDs? – Calum Apr 2 at 14:12
2

You should add the following setting in Sitecore.Analytics.Tracking.config just below the <settings> section:

<setting name="Analytics.CookieDomain" value=".xxx.com">

  • 1
    Add more details to your answer like description why this solves the problem and why answer from February that was already accepted is not good from your point of view. Otherwise please delete this answer and make it as a comment – Peter Procházka Jul 12 '18 at 6:37
  • this solution will add cookie domain ONLY for the "SC_ANALYTICS_GLOBAL_COOKIE" cookie for all your domain and sub domains! where as adding the httpcookie domain value at the web.config will get affect or it forces all your cookies to point to the main domain. – Iam007Eshwar Jul 12 '18 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.