The following reply was made to PR mod_usertrack/5006; it has been noted by 
GNATS.

From: Eric van der Vlist <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Cc:  Subject: Re: mod_usertrack/5006: Cookie can be set only for host
Date: Wed, 15 Sep 1999 00:34:08 +0200

 I have just tested the proposed patch and I have noticed a caveat with
 the usage of cookiebuf to print the value of the domain name : cookiebuf
 is used to log the first value of the cookie and the corresponding entry
 in the logs are corrupted.
 
 I would rather propose to prepare the formatted string in
 set_cookie_domain :
 
 static const char *set_cookie_domain(cmd_parms *cmd, void *mconfig, char
 *name)
 {
     cookie_dir_rec *dcfg = (cookie_dir_rec *) mconfig;
 
     dcfg->cookie_domain =  ap_pcalloc(cmd->pool, strlen(name)+11);
     ap_snprintf(dcfg->cookie_domain,  strlen(name)+11, " domain=%s;",
 name);
 
     return NULL;
 }
 
 and to print it directly into new_cookie :
 
 ../..
 
         /* Cookie with date; as strftime '%a, %d-%h-%y %H:%M:%S GMT' */
         new_cookie = ap_psprintf(r->pool,
                 "%s=%s; %spath=/; expires=%s, %.2d-%s-%.2d
 %.2d:%.2d:%.2d GMT",
                     dcfg->cookie_name, cookiebuf,
                     dcfg->cookie_domain,
                     ap_day_snames[tms->tm_wday],
                     tms->tm_mday, ap_month_snames[tms->tm_mon],
                     tms->tm_year % 100,
                     tms->tm_hour, tms->tm_min, tms->tm_sec);
     }
     else {
         new_cookie = ap_psprintf(r->pool, "%s=%s; %spath=/",
                                  dcfg->cookie_name, cookiebuf,
 dcfg->cookie_doma
 in);
     }
 
 assuming it has also been initialized to an empty string :
 
        dcfg->cookie_domain = "";
 
 Thanks for allowing me to use apache ;=)
 
 Eric
 
 -- 
 ------------------------------------------------------------------------
 Eric van der Vlist                                              Dyomedea
 
 http://www.dyomedea.com                          http://www.ducotede.com
 ------------------------------------------------------------------------

Reply via email to