My Account | Buy CometChat

documentation

Using CometChat across multiple subdomains

v3.0.9 features cross-domain support. You can run CometChat across multiple domains/sub-domains using this feature.

An ideal use of this feature is when you have CometChat installed at www.yoursite.com and want to also use it on abc.yoursite.com.

To allow your sub-domains to use CometChat as well, perform the following steps:

  • Edit cometchat/config.php and set BASE_URL to the full path e.g. http://www.yoursite.com/cometchat/
  • Then set CROSS_DOMAIN to 1

Cross domain support

  • Add the following code to the site template of your sub-domains (remember to include the full URL path).

Add the code immediately after <head> tag:

<link type="text/css" rel="stylesheet" media="all" href="http://www.yoursite.com/cometchat/cometchatcss.php" /> 
<script type="text/javascript" src="http://www.yoursite.com/cometchat/cometchatjs.php" charset="utf-8"></script>

Your users must be logged into your main site inorder to use CometChat in your sub-domains.

Use of CometService or alternatives is strongly recommended when using CometChat in cross-domain environment.