Depending on your internal security and privacy policies related to cookies, you may want to control how the Crisp chatbox uses cookies.
Restrict Cookie to Domain
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>
Change Cookie Expiration Date
If you are concerned about the privacy of your users, and want the chatbox session cookie to expire sooner than default (6 months), you can easily alter this expire time from your JavaScript code.
You can do so using the Crisp Cookie Expire chatbox variable. The expire time is set in seconds. The cookie expiration time is prolonged every time a visitor with an existing cookie access your website.
How To Change Chatbox Cookie Expire Date?
Chatbox cookie default expire date can be adjusted, using the CRISP_COOKIE_EXPIRE
variable.
You can use the following Crisp chatbox code (fill CRISP_COOKIE_EXPIRE
with your adjusted expire time in seconds):
<script type="text/javascript">
$crisp = [];
CRISP_COOKIE_EXPIRE = 3600; // Expire time in seconds, here: 1 hour = 3600 seconds
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>
3600
.