--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: apache: mod_usertrack enhancement [patch]
- From: Patrik Rak <patrik@ein.cz>
- Date: Wed, 01 Sep 1999 16:09:16 +0200
- Message-id: <E11MB4e-0001Jy-00@eagle.int.ein.cz>
Package: apache
Version: 1.3.3-7
Severity: wishlist
Hi!
One problem with mod_usertrack is that it generates lot of bogus unique
users for clients which never send a cookie (like indexing robots),
making the results completely useless.
One way would be just to set the cookie note for incoming cookies, and not
for the just generated ones. This solves the problem with robots and the
unique users count will be correct (or almost).
However, such solution prevents counting of new users (unless you have
complete cookie database, too).
The solution below is designed so it sets one additional apache note,
cookiedir, which contains "in" when the cookie came from the requests and "out"
when the cookie is being sent out for the first time. (Note that it can
also be unset for requests where no cookie was generated - this usually
happens for requests which generate some kind of error response. In this
case, %{cookiedir}n comes out as single dash, as usual).
This way the logs can contain complete information about what was going on.
Patrik
P.S. You might like to send this one upstream...
--- mod_usertrack.c.orig Wed Jul 8 12:47:19 1998
+++ mod_usertrack.c Fri Aug 27 06:15:47 1999
@@ -96,6 +96,11 @@
*
* Mark Cox, mark@ukweb.com, 6 July 95
*
+ * Also set cookiedir note to "in" or "out" to recognize if the cookie
+ * came from the request or if it was just sent out.
+ *
+ * Patrik Rak, patrik@raxoft.cz, 27 August 1999
+ *
* This file replaces mod_cookies.c
*/
@@ -195,6 +200,7 @@
ap_table_setn(r->headers_out, "Set-Cookie", new_cookie);
ap_table_setn(r->notes, "cookie", ap_pstrdup(r->pool, cookiebuf)); /* log first time */
+ ap_table_setn(r->notes, "cookiedir", ap_pstrdup(r->pool, "out"));
return;
}
@@ -220,6 +226,7 @@
/* Set the cookie in a note, for logging */
ap_table_setn(r->notes, "cookie", cookiebuf);
+ ap_table_setn(r->notes, "cookiedir", ap_pstrdup(r->pool, "in"));
return DECLINED; /* Theres already a cookie, no new one */
}
--- End Message ---