2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
5 <modulesynopsis metafile="mod_usertrack.xml.meta">
6 <name>mod_usertrack</name>
8 <em>Clickstream</em> logging of user activity on a site
10 <status>Extension</status>
11 <sourcefile>mod_usertrack.c</sourcefile>
12 <identifier>usertrack_module</identifier>
15 <p>Previous releases of Apache have included a module which
16 generates a 'clickstream' log of user activity on a site using
17 cookies. This was called the "cookies" module, mod_cookies. In
18 Apache 1.2 and later this module has been renamed the "user
19 tracking" module, mod_usertrack. This module has been
20 simplified and new directives added.</p>
25 <title>Logging</title>
27 <p>Previously, the cookies module (now the user tracking
28 module) did its own logging, using the <directive>CookieLog</directive>
29 directive. In this release, this module does no logging at all.
30 Instead, a configurable log format file should be used to log
31 user click-streams. This is possible because the logging module
32 now allows multiple log files. The cookie itself is logged by
33 using the text <code>%{cookie}n</code> in the log file format. For
36 CustomLog logs/clickstream "%{cookie}n %r %t"
39 <p>For backward compatibility the configurable log module
40 implements the old <directive
41 module="mod_log_config">CookieLog</directive> directive, but this
42 should be upgraded to the above <directive
43 module="mod_log_config">CustomLog</directive> directive. </p>
47 <title>2-digit or 4-digit dates for cookies?</title>
49 <p>(the following is from message
50 <022701bda43d$9d32bbb0$1201a8c0@christian.office.sane.com>
51 in the new-httpd archives) </p>
53 From: "Christian Allen" <christian@sane.com>
54 Subject: Re: Apache Y2K bug in mod_usertrack.c
55 Date: Tue, 30 Jun 1998 11:41:56 -0400
57 Did some work with cookies and dug up some info that might be useful.
59 True, Netscape claims that the correct format NOW is four digit dates, and
60 four digit dates do in fact work... for Netscape 4.x (Communicator), that
61 is. However, 3.x and below do NOT accept them. It seems that Netscape
62 originally had a 2-digit standard, and then with all of the Y2K hype and
63 probably a few complaints, changed to a four digit date for Communicator.
64 Fortunately, 4.x also understands the 2-digit format, and so the best way to
65 ensure that your expiration date is legible to the client's browser is to
68 However, this does not limit expiration dates to the year 2000; if you use
69 an expiration year of "13", for example, it is interpreted as 2013, NOT
70 1913! In fact, you can use an expiration year of up to "37", and it will be
71 understood as "2037" by both MSIE and Netscape versions 3.x and up (not sure
72 about versions previous to those). Not sure why Netscape used that
73 particular year as its cut-off point, but my guess is that it was in respect
74 to UNIX's 2038 problem. Netscape/MSIE 4.x seem to be able to understand
75 2-digit years beyond that, at least until "50" for sure (I think they
76 understand up until about "70", but not for sure).
78 Summary: Mozilla 3.x and up understands two digit dates up until "37"
79 (2037). Mozilla 4.x understands up until at least "50" (2050) in 2-digit
80 form, but also understands 4-digit years, which can probably reach up until
81 9999. Your best bet for sending a long-life cookie is to send it for some
82 time late in the year "37".
88 <name>CookieDomain</name>
89 <description>The domain to which the tracking cookie applies</description>
90 <syntax>CookieDomain <em>domain</em></syntax>
92 <context>server config</context>
93 <context>virtual host</context>
94 <context>directory</context>
95 <context>.htaccess</context>
97 <override>FileInfo</override>
101 <p>This directive controls the setting of the domain to which
102 the tracking cookie applies. If not present, no domain is
103 included in the cookie header field.</p>
105 <p>The domain string <strong>must</strong> begin with a dot, and
106 <strong>must</strong> include at least one embedded dot. That is,
107 ".foo.com" is legal, but "foo.bar.com" and ".com" are not.</p>
113 <name>CookieExpires</name>
114 <description>Expiry time for the tracking cookie</description>
115 <syntax>CookieExpires <em>expiry-period</em></syntax>
117 <context>server config</context>
118 <context>virtual host</context>
119 <context>directory</context>
120 <context>.htaccess</context>
122 <override>FileInfo</override>
125 <p>When used, this directive sets an expiry time on the cookie
126 generated by the usertrack module. The <em>expiry-period</em>
127 can be given either as a number of seconds, or in the format
128 such as "2 weeks 3 days 7 hours". Valid denominations are:
129 years, months, weeks, days, hours, minutes and seconds. If the expiry
130 time is in any format other than one number indicating the
131 number of seconds, it must be enclosed by double quotes.</p>
133 <p>If this directive is not used, cookies last only for the
134 current browser session.</p>
139 <name>CookieName</name>
140 <description>Name of the tracking cookie</description>
141 <syntax>CookieName <em>token</em></syntax>
142 <default>CookieName Apache</default>
144 <context>server config</context>
145 <context>virtual host</context>
146 <context>directory</context>
147 <context>.htaccess</context>
149 <override>FileInfo</override>
152 <p>This directive allows you to change the name of the cookie
153 this module uses for its tracking purposes. By default the
154 cookie is named "<code>Apache</code>".</p>
156 <p>You must specify a valid cookie name; results are
157 unpredictable if you use a name containing unusual characters.
158 Valid characters include A-Z, a-z, 0-9, "_", and "-".</p>
163 <name>CookieStyle</name>
164 <description>Format of the cookie header field</description>
166 <em>Netscape|Cookie|Cookie2|RFC2109|RFC2965</em></syntax>
167 <default>CookieStyle Netscape</default>
169 <context>server config</context>
170 <context>virtual host</context>
171 <context>directory</context>
172 <context>.htaccess</context>
174 <override>FileInfo</override>
177 <p>This directive controls the format of the cookie header
178 field. The three formats allowed are:</p>
181 <li><strong>Netscape</strong>, which is the original but now deprecated
182 syntax. This is the default, and the syntax Apache has
183 historically used.</li>
185 <li><strong>Cookie</strong> or <strong>RFC2109</strong>, which is the syntax that
186 superseded the Netscape syntax.</li>
188 <li><strong>Cookie2</strong> or <strong>RFC2965</strong>, which is the most
189 current cookie syntax.</li>
192 <p>Not all clients can understand all of these formats. but you
193 should use the newest one that is generally acceptable to your
201 <name>CookieTracking</name>
202 <description>Enables tracking cookie</description>
203 <syntax>CookieTracking on|off</syntax>
204 <default>CookieTracking off</default>
206 <context>server config</context>
207 <context>virtual host</context>
208 <context>directory</context>
209 <context>.htaccess</context>
211 <override>FileInfo</override>
214 <p>When the user track module is compiled in, and
215 "CookieTracking on" is set, Apache will start sending a
216 user-tracking cookie for all new requests. This directive can
217 be used to turn this behavior on or off on a per-server or
218 per-directory basis. By default, compiling mod_usertrack will
219 not activate cookies. </p>