I am getting this error message frequently in my logs. Anyone know how to fix?

PHP Notice: Undefined property: stdClass::$global_sid in /drupal/sites/all/modules/sso/client/singlesignon_client.module on line 47

CommentFileSizeAuthor
#3 869830_1_0.patch956 bytesAs If

Comments

mikebann’s picture

try clearing your cache under perfrmance - is it usually after you install a new module?

As If’s picture

Getting same error. I cleared all caches on all sites (master and clients). This error still appears for all client sites.

[UPDATE 1]: This problem comes back occassionally when I'm testing out various configurations, and I think the cookie is related. The way I get past it now is (1) leave the site, (2) clear all cookies including session cookies, (3) clear all cache tables via PHPMyAdmin.

[UPDATE 2]: Each of my client sites was using the master's domain for the cookie domain. I commented out the cookie domain in all my settings.php files, and the error stopped appearing on my sites.

[UPDATE 3]: However, the error WAS still appearing in my error logs. I examined the code and found what I believe to be a syntax error. This conditional...

    if (!isset($user->global_sid) && ($user->global_sid != '')) {
      session_save_session(FALSE);
    }

...will never return a meaningful result because it is looking for a situation where the global sid is NOT SET *AND* SET but not equal to an empty string. I changed it to this:

    if (!isset($user->global_sid)) {
      session_save_session(FALSE);
    } elseif (isset($user->global_sid) && ($user->global_sid != '')) {
      session_save_session(FALSE);
    }

...and now the errors have finally stopped appearing in my error logs.

As If’s picture

Status: Active » Needs review
Issue tags: +error patches global_sid singlesignon
StatusFileSize
new956 bytes

Here is a patch for the above mod. Run it in the client folder. Please review.

Note: This patch also incorporates the codefix from http://drupal.org/node/596034 (on line 40).

Gryfalcon’s picture

While applying the fix given in #2, while it got rid of the errors, I found it caused other problems, such as being unable to apply default Drupal filters, ie: showing a list of a certain node type.

Looking at the code, I'm thinking the intent was to check if the global_sid was either not set, or was set but empty. As such, I changed

   if (!isset($user->global_sid) && ($user->global_sid != '')) {
      session_save_session(FALSE);
    }

to

    if (!isset($user->global_sid) || (isset($user->global_sid) && ($user->global_sid == ''))){
      session_save_session(FALSE);
    }

which seems to have stopped the errors, without affecting other parts of the site as well.