CometChat Doesn't Recognize Logged In Users

Sorry to bother you with this but CometChat tech support is not available until Monday and I need to get my Chat Rooms running for my regulars.

I had updated to their latest version 6.3 but the GUI was so awful that I decided to revert to an older version. I tried 6.2.5 but it threw off the formatting of my content and widgets, so I am back to v6.1.

CometChat is not recognizing my logged in users, including me.

I have tried uploading backups but with no success. This is how it stands now.

I have uploaded a clean version of v6.1 and made the following changes.

#1 cometchat/integration.php – change 4 instances of wp-content to mary-content

#2 cometchat/config.php
Line 78: define('BASE_URL',setConfigValue('','/cometchat/'));
Line 337: Set CROSS_DOMAIN to 1
Line 342: Set CC_SITE_URL to your site’s URL e.g.
define('CC_SITE_URL', setConfigValue('',''));

Add under
// Pulls the language file if found


if (!defined('DB_AVATARFIELD')) {

#3 themes/generatepress-child/header.php - Add the following 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" target="_blank" href="" />
<script type="text/javascript" src="" charset="utf-8"></script>

Can you tell me please what I am missing that CometChat is not recognizing my logged in users.

Support Access is granted.

  • Adam Czajczyk
    • Support Gorilla

    Hello Mary,

    I hope you're well today and thank you for your question!

    I'm not that familiar with CometChat but let me try :slight_smile:

    After checking your site I noticed that this is the exact code that you put into your child theme's "header.php" file:

    var userid = 'USERID'; // Must be populated programmatically
    document.cookie = "cc_data="+userid;

    The second line specifically says that the USERID must be populated so it seems that the USERID string here is just a "placholder".

    I would try replacing this line in the code:

    var userid = 'USERID'; // Must be populated programmatically

    with this one

    var userid = '<?php echo get_current_user_id(); ?>'; //Must be populate programmatically

    Give it a try please and let me know if that works for you.

    Best regards,

  • Mary
    • Wisp of the WP Loop

    Thank you Adam. Now it appears that cometchat is recognizing logged in users, and I can type a message but it doesn't show up for anyone else.

    I am logged in in Chrome as "test" and in Firefox as "mary". I can't see the other's posts.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.