Hosting CometChat on a separate server/sub-domain

CometChat has full cross-domain support. You can run CometChat on a separate server, domain/sub-domain. Note, some plugins like page translation may not work when used in cross-domain environment.

An ideal use of this feature is when you want to load CometChat on a separate server e.g. and want to use CometChat on

Perform the following steps:

* Upload and configure CometChat on your sub-domain following the standard installation instructions.

* Edit cometchat/config.php and set BASE_URL to the full path e.g.
* Then set CROSS_DOMAIN to 1 and set CC_SITE_URL to your site’s URL e.g.

* Add the following code to the site template (remember to include the full URL path).

Add the code immediately after <head> tag:

var userid = 'USERID'; // Must be populated programmatically
document.cookie = "cc_data="+userid;
<link type="text/css" rel="stylesheet" media="all" href="" /> 
<script type="text/javascript" src="" charset="utf-8"></script>

Use of CometService or alternatives is strongly recommended when using CometChat in cross-domain environment. This guide will work for custom coded sites only.

Not finding what you need?

The CometChat team is here to help!