diff -r -C3 apache_1.3.11.orig/htdocs/manual/mod/directives.html apache_1.3.11/htdocs/manual/mod/directives.html *** apache_1.3.11.orig/htdocs/manual/mod/directives.html Fri Feb 18 12:05:29 2000 --- apache_1.3.11/htdocs/manual/mod/directives.html Fri Feb 18 12:07:18 2000 *************** *** 92,97 **** --- 92,98 ----
  • CookieLog (mod_cookies)
  • CookieLog (mod_log_config)
  • CookieTracking +
  • CookiePagesOnly
  • CoreDumpDirectory
  • CustomLog
  • DefaultIcon Only in apache_1.3.11/htdocs/manual/mod: directives.html~ diff -r -C3 apache_1.3.11.orig/htdocs/manual/mod/mod_usertrack.html apache_1.3.11/htdocs/manual/mod/mod_usertrack.html *** apache_1.3.11.orig/htdocs/manual/mod/mod_usertrack.html Fri Feb 18 12:05:29 2000 --- apache_1.3.11/htdocs/manual/mod/mod_usertrack.html Fri Feb 18 12:06:05 2000 *************** *** 55,60 **** --- 55,61 ----
  • CookieExpires
  • CookieName
  • CookieTracking +
  • CookiePagesOnly
    *************** *** 156,161 **** --- 157,194 ---- requests. This directive can be used to turn this behavior on or off on a per-server or per-directory basis. By default, compiling mod_usertrack will not activate cookies. + +

    CookiePagesOnly

    + Syntax: CookiePagesOnly on | off
    + Context: server config, virtual host, directory, + .htaccess
    + Override: FileInfo
    + Status: optional
    + Module: mod_usertrack

    + + If "CookiePagesOnly on" is set, user-tracking cookies will only be set + when content of type text/html is served. This makes things more + pleasant for visitors to a site who have their browsers configured to + alert them whenever a cookie is being set. If they wish to reject the + cookies for the site they need only do so for each page served, + instead of for each page and (for example) all images loaded off it. + This directive can be used to turn this behavior on or off on a + per-server or per-directory basis.


    diff -r -C3 apache_1.3.11.orig/src/modules/standard/mod_usertrack.c apache_1.3.11/src/modules/standard/mod_usertrack.c *** apache_1.3.11.orig/src/modules/standard/mod_usertrack.c Fri Feb 18 12:05:28 2000 --- apache_1.3.11/src/modules/standard/mod_usertrack.c Fri Feb 18 12:06:05 2000 *************** *** 94,99 **** --- 94,102 ---- * never expires. You would then get the same Cookie each time the * user revisits your site. * + * CookiePagesOnly modifications: + * Eric S. Tiedemann, est@hyperreal.org, 14 Feb 00 + * * Mark Cox, mark@ukweb.com, 6 July 95 * * This file replaces mod_cookies.c *************** *** 116,121 **** --- 119,125 ---- typedef struct { int enabled; char *cookie_name; + int pages_only; } cookie_dir_rec; /* Define this to allow post-2000 cookies. Cookies use two-digit dates, *************** *** 229,234 **** --- 233,242 ---- return DECLINED; } + if (dcfg->pages_only && strcmp(r->content_type, "text/html") != 0) { + return DECLINED; + } + if ((cookie = ap_table_get(r->headers_in, "Cookie"))) if ((value = strstr(cookie, dcfg->cookie_name))) { char *cookiebuf, *cookieend; *************** *** 265,270 **** --- 273,279 ---- dcfg = (cookie_dir_rec *) ap_pcalloc(p, sizeof(cookie_dir_rec)); dcfg->cookie_name = COOKIE_NAME; dcfg->enabled = 0; + dcfg->pages_only = 0; return dcfg; } *************** *** 276,281 **** --- 285,298 ---- return NULL; } + static const char *set_cookie_pages_only(cmd_parms *cmd, void *mconfig, int arg) + { + cookie_dir_rec *dcfg = mconfig; + + dcfg->pages_only = arg; + return NULL; + } + static const char *set_cookie_exp(cmd_parms *parms, void *dummy, const char *arg) { cookie_log_state *cls = ap_get_module_config(parms->server->module_config, *************** *** 358,363 **** --- 375,382 ---- "whether or not to enable cookies"}, {"CookieName", set_cookie_name, NULL, OR_FILEINFO, TAKE1, "name of the tracking cookie"}, + {"CookiePagesOnly", set_cookie_pages_only, NULL, OR_FILEINFO, FLAG, + "whether or not to set cookies only for text/html served"}, {NULL} };