auth_key not set ... (!CRAM-MD5 issue) ...

Marc G. Fournier scrappy@hub.org
Fri, 15 Feb 2002 22:27:52 -0400 (AST)


Chuck ...

	Okay, following what you said, that there is supposed to be a
'cookie' set for auth_key, I added some more debugging ... auth_key is
apparently set in index.php, and is the first cookie set, using
Secret::setKey:

    function setKey($keyname = 'generic')
    {
        openlog("SetKey", LOG_PID, LOG_LOCAL2);
        syslog(LOG_DEBUG, "Setting key for $keyname");
        if (isset($GLOBALS['HTTP_COOKIE_VARS']) && (count($GLOBALS['HTTP_COOKIE_VARS']) > 0)) {
            syslog(LOG_DEBUG, "... HTTP_COOKIE_VARS");
            if (isset($GLOBALS['HTTP_COOKIE_VARS'][$keyname . '_key'])) {
                syslog(LOG_DEBUG, "... $keyname already set");
                $key = $GLOBALS['HTTP_COOKIE_VARS'][$keyname . '_key'];
            } else {
                syslog(LOG_DEBUG, "... $keyname is being set");
                Secret::srand();
                $key = md5(uniqid(mt_rand()));
                $GLOBALS['HTTP_COOKIE_VARS'][$keyname . '_key'] = $key;
                setcookie($keyname . '_key', $key, null, $GLOBALS['registry']->getParam('cookie_path'), $GLOBALS['registry']->getParam('cookie_domain'));
            }
        } else {
            syslog(LOG_DEBUG, "... else for $keyname");
            $key = md5(session_id() . $GLOBALS['registry']->getParam('server_name'));
        }

        return $key;
    }

Now, for the first run through, I'm getting the following in my logs:

Feb 15 22:24:20 earth SetKey[46029]: Setting key for auth
Feb 15 22:24:20 earth SetKey[46029]: ... else for auth
Feb 15 22:24:24 earth SetKey[46029]: Setting key for imp
Feb 15 22:24:24 earth SetKey[46029]: ... HTTP_COOKIE_VARS
Feb 15 22:24:24 earth SetKey[46029]: ... imp is being set

The 'else' doesn't do a 'setcookie' ... should it?