By default, Crisp shares its chatbox domain on your primary domain, and all its sub-domains. This lets you share the same chatbox session across all your website & apps. In some specific use cases, you may want to restrict the cookie to a given domain.

You can do so using the Crisp Cookie Domain chatbox variable. The domain name is set as a string, and points to your base domain by default.

For instance, if your website domain is www.acme.com, the base domain would be acme.com, and the cookie would be shared with eg. app.acme.com and help.acme.com and others. You may want to avoid that, and restrict the cookie to eg. app.acme.com only.

How To Change Chatbox Cookie Domain?

Chatbox cookie auto-detected base domain can be adjusted, using the CRISP_COOKIE_DOMAIN variable.

You can use the following Crisp chatbox code (fill CRISP_COOKIE_DOMAIN with your domain):

<script type="text/javascript">
$crisp = [];
CRISP_COOKIE_DOMAIN = 'app.acme.com'; // Domain to restrict the cookie to
CRISP_WEBSITE_ID = 'MyWebsiteID';
(function(){d=document;s=d.createElement('script');s.src='//client.crisp.chat/l.js';s.async=1;d.getElementsByTagName('head')[0].appendChild(s);})();
</script>


You need to ensure the altered cookie domain variable is set on every page that has the chatbox included on. If a visitor accesses a page where you're not setting this variable, the default auto-domain cookie will be used, and thus the user session will be different on those pages.
Was this article helpful?
Thank you!