CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Who's Online seems to be overstated when Civicrm module enabled
Pages: [1]

Author Topic: Who's Online seems to be overstated when Civicrm module enabled  (Read 1919 times)

svh

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
Who's Online seems to be overstated when Civicrm module enabled
September 27, 2009, 08:37:48 pm
I have recently added Civicrm to our Drupal installation and it seems to be working OK.

I noticed a sudden increase in the number of guests reported as online in the Drupal Who's Online block shortly after I configured Civicrm.  Sometimes this figure jumps from the 1 or 2 expected guests to over 100.

The only other reference to this problem that I can find is this one from April 2007 but no solution was given. http://drupal.org/node/138935#comment-2065514

This definitely seems to be related to enabling the main Civicrm module.  The only other Civicrm module I have enabled is CiviMember Roles Sync but the problem became apparent before I activated this.  I did try at one point disabling Civicrm and everything immediately returned to normal.

Any suggestions for fixes or where to look for what might be causing the problem would be appreciated.

Thanks and regards
Steven


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Who's Online seems to be overstated when Civicrm module enabled
September 28, 2009, 08:01:27 am

your best bet would be to look at the who's online code in drupal and see what happens

Note that civicrm uses the sessions for anonymous users also. So loading a civicrm page/block will use the session. Not sure of what the online code considers as "who's online"

if you do figure this out, please report back

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

svh

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
Re: Who's Online seems to be overstated when Civicrm module enabled
September 30, 2009, 03:27:34 pm
Thanks lobo

I have had a bit of a look at this to see if I can locate the problem but I haven't gotten very far.  I am still new to Drupal and Civicrm.

The user count comes from the sessions table in Drupal.  The system merely counts the number of sessions that have been active recently.  This count happens in the function sess_count in includes/session.inc.

After installing CiviCRM nearly every session recorded seems to have CiviCRM at the front of the recorded details.  I can only surmise that Civicrm is creating new sessions rather than updating existing ones.  I have looked at the sessions code in Civicrm (sites/all/modules/civicrm/CRM/Core/Session.php) but it is a bit beyond me.

Since our Anonymous users don't have access to Civicrm I thought I may be able to identify the extra sessions from the session column in the sessions table and modify the user sess_count function to ignore the extra sessions but I haven't been able to get this to work.

I also thought this may be related to web crawlers.  I have checked a few of the ip addresses and certainly some relate to things like Google.  However, when I log in to the site as myself and start clicking around on the Civicrm pages the anonymous user count immediately starts to climb.  This seems to indicate Civicrm is somehow using the session table to keep data independent of the Drupal session but that doesn't make sense.

Any other suggestions gratefully accepted.

Regards
Steven

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Who's Online seems to be overstated when Civicrm module enabled
September 30, 2009, 06:51:29 pm

most likely your drupal user table does not have an entry for uid = 0 and hence a new session is created for an anon user on every page load

there seems to be a bug in some module which deletes that row. You might want to insert it from a clean drupal install. From my install, here are the contents:

Code: [Select]
mysql> select * from users where uid = 0 \G;
*************************** 1. row ***************************
          uid: 0
         name:
         pass:
         mail:
         mode: 0
         sort: 0
    threshold: 0
        theme:
    signature:
      created: 0
       access: 0
        login: 0
       status: 0
     timezone: NULL
     language:
      picture:
         init:
         data: NULL
timezone_name:
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

adshill

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 8
Re: Who's Online seems to be overstated when Civicrm module enabled
October 01, 2009, 03:31:30 am
Hi there,

I've had this problem for a long time now and I think posted about it previously. I have exactly the same symptoms, that

-the online users climbs as I move around civicrm pages
-the sessions almost all have CiviCRM in the "session" column of the database
-all uid values are set to 0 (this is very strange!)
-if I disable CiviCRM, then the count works as normal and goes down to a more reasonable level

While not able at the moment to spend time on it I just thought I'd mention that this is for sure something that we can replicate. We have a user 0 in the drupal user database so I don't think this is the issue - did this solve it for you svh?

Thanks and sorry not to be more helpful, but just wanted to echo that this is also happening elsewhere incase I can help to debug in some way!

Adam

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Who's Online seems to be overstated when Civicrm module enabled
October 01, 2009, 09:54:52 am

Would be great if either one of u'll could debug and figure out this issue. Note that Drupal does all the session management, CiviCRM uses the session created by drupal quite extensively (on all page / form loads)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Guy Iaccarino

  • I post occasionally
  • **
  • Posts: 92
  • Karma: 5
    • Greenleaf Advancement
  • CiviCRM version: 4.4.10, 4.5.4
  • CMS version: WordPress 4, Drupal 7, Drupal 6, Joomla 3
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Who's Online seems to be overstated when Civicrm module enabled
February 13, 2011, 12:28:02 pm
is this still an open issue? I am experiencing it as well and was wondering if others are.
Guy Iaccarino
www.greenleafadvancement.com

svh

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
Re: Who's Online seems to be overstated when Civicrm module enabled
February 13, 2011, 12:36:14 pm
I never managed to solve it.

Regards
Steven

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Who's Online seems to be overstated when Civicrm module enabled

This forum was archived on 2017-11-26.