Received: (qmail 24432 invoked by uid 2012); 13 Sep 1999 19:46:09 -0000 Message-Id: <19990913194609.24431.qmail@hyperreal.org> Date: 13 Sep 1999 19:46:09 -0000 From: Vadim Zaliva Reply-To: lord@crocodile.org To: apbugs@hyperreal.org Subject: Cookie can be set only for host X-Send-Pr-Version: 3.2 >Number: 5006 >Category: mod_usertrack >Synopsis: Cookie can be set only for host >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: open >Class: change-request >Submitter-Id: apache >Arrival-Date: Mon Sep 13 12:50:01 PDT 1999 >Last-Modified: Wed Sep 15 00:30:00 PDT 1999 >Originator: lord@crocodile.org >Organization: apache >Release: 1.3 >Environment: Redhat Linux 6, egcs-2.91.66 >Description: Now mod_usertrack sets cookie only for host which is running apache. However in some configurations, when you run cluster of apache servers serving different sites under same domain (for example: dev.apache.org, bugs.apache.org, www.apache.org) it is desirable to preserve cookie information between servers. >How-To-Repeat: To achive that, I've developed patch: ftp://ftp.crocodile.org/pub/apache-patches/mod_usertrack.cookie_domain.patch Which adds additional keyword 'CookieDomain' which controls for what domain cookie should be set. In example above, it should be set to '.apache.org'. >Fix: >Audit-Trail: From: Eric van der Vlist To: apbugs@apache.org, lord@crocodile.org 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 ------------------------------------------------------------------------ From: Vadim Zaliva To: Eric van der Vlist Cc: apbugs@apache.org Subject: Re: mod_usertrack/5006: Cookie can be set only for host Date: Tue, 14 Sep 1999 15:53:02 -0700 (PDT) I agree with Eric correction. To avoid confusion in future I suggest renaming cookiebuf to cookiename. Vadim -- ;;----------------------------------+-----------------------------------+ ;; Vadim Zaliva + Those who do not understand Unix + ;; mailto:lord@crocodile.org + are condemned to reinvent it, + ;; http://www.crocodile.org + poorly. (H. Spencer) + ;;----------------------------------+-----------------------------------+ From: Eric van der Vlist To: Vadim Zaliva Cc: apbugs@apache.org Subject: Re: mod_usertrack/5006: Cookie can be set only for host Date: Wed, 15 Sep 1999 09:27:48 +0200 Vadim, This patch is now available on our site : http://patches.dyomedea.com/apache/1.3.9/mod_usertrack.domain_name/ Thanks Eric -- ------------------------------------------------------------------------ Eric van der Vlist Dyomedea http://www.dyomedea.com http://www.ducotede.com ------------------------------------------------------------------------ >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]