2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
7 Copyright 2002-2006 The Apache Software Foundation or its licensors, as
10 Licensed under the Apache License, Version 2.0 (the "License");
11 you may not use this file except in compliance with the License.
12 You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <modulesynopsis metafile="mod_usertrack.xml.meta">
24 <name>mod_usertrack</name>
26 <em>Clickstream</em> logging of user activity on a site
28 <status>Extension</status>
29 <sourcefile>mod_usertrack.c</sourcefile>
30 <identifier>usertrack_module</identifier>
33 <p>Previous releases of Apache have included a module which
34 generates a 'clickstream' log of user activity on a site using
35 cookies. This was called the "cookies" module, mod_cookies. In
36 Apache 1.2 and later this module has been renamed the "user
37 tracking" module, mod_usertrack. This module has been
38 simplified and new directives added.</p>
42 <section id="logging">
43 <title>Logging</title>
45 <p>Previously, the cookies module (now the user tracking
46 module) did its own logging, using the <directive>CookieLog</directive>
47 directive. In this release, this module does no logging at all.
48 Instead, a configurable log format file should be used to log
49 user click-streams. This is possible because the logging module
50 now allows multiple log files. The cookie itself is logged by
51 using the text <code>%{cookie}n</code> in the log file format. For
54 CustomLog logs/clickstream "%{cookie}n %r %t"
57 <p>For backward compatibility the configurable log module
58 implements the old <directive
59 module="mod_log_config">CookieLog</directive> directive, but this
60 should be upgraded to the above <directive
61 module="mod_log_config">CustomLog</directive> directive. </p>
64 <section id="cookiedate">
65 <title>2-digit or 4-digit dates for cookies?</title>
67 <p>(the following is from message
68 <022701bda43d$9d32bbb0$1201a8c0@christian.office.sane.com>
69 in the new-httpd archives) </p>
71 From: "Christian Allen" <christian@sane.com>
72 Subject: Re: Apache Y2K bug in mod_usertrack.c
73 Date: Tue, 30 Jun 1998 11:41:56 -0400
75 Did some work with cookies and dug up some info that might be useful.
77 True, Netscape claims that the correct format NOW is four digit dates, and
78 four digit dates do in fact work... for Netscape 4.x (Communicator), that
79 is. However, 3.x and below do NOT accept them. It seems that Netscape
80 originally had a 2-digit standard, and then with all of the Y2K hype and
81 probably a few complaints, changed to a four digit date for Communicator.
82 Fortunately, 4.x also understands the 2-digit format, and so the best way to
83 ensure that your expiration date is legible to the client's browser is to
86 However, this does not limit expiration dates to the year 2000; if you use
87 an expiration year of "13", for example, it is interpreted as 2013, NOT
88 1913! In fact, you can use an expiration year of up to "37", and it will be
89 understood as "2037" by both MSIE and Netscape versions 3.x and up (not sure
90 about versions previous to those). Not sure why Netscape used that
91 particular year as its cut-off point, but my guess is that it was in respect
92 to UNIX's 2038 problem. Netscape/MSIE 4.x seem to be able to understand
93 2-digit years beyond that, at least until "50" for sure (I think they
94 understand up until about "70", but not for sure).
96 Summary: Mozilla 3.x and up understands two digit dates up until "37"
97 (2037). Mozilla 4.x understands up until at least "50" (2050) in 2-digit
98 form, but also understands 4-digit years, which can probably reach up until
99 9999. Your best bet for sending a long-life cookie is to send it for some
100 time late in the year "37".
106 <name>CookieDomain</name>
107 <description>The domain to which the tracking cookie applies</description>
108 <syntax>CookieDomain <em>domain</em></syntax>
110 <context>server config</context>
111 <context>virtual host</context>
112 <context>directory</context>
113 <context>.htaccess</context>
115 <override>FileInfo</override>
119 <p>This directive controls the setting of the domain to which
120 the tracking cookie applies. If not present, no domain is
121 included in the cookie header field.</p>
123 <p>The domain string <strong>must</strong> begin with a dot, and
124 <strong>must</strong> include at least one embedded dot. That is,
125 ".foo.com" is legal, but "foo.bar.com" and ".com" are not.</p>
131 <name>CookieExpires</name>
132 <description>Expiry time for the tracking cookie</description>
133 <syntax>CookieExpires <em>expiry-period</em></syntax>
135 <context>server config</context>
136 <context>virtual host</context>
137 <context>directory</context>
138 <context>.htaccess</context>
140 <override>FileInfo</override>
143 <p>When used, this directive sets an expiry time on the cookie
144 generated by the usertrack module. The <em>expiry-period</em>
145 can be given either as a number of seconds, or in the format
146 such as "2 weeks 3 days 7 hours". Valid denominations are:
147 years, months, weeks, days, hours, minutes and seconds. If the expiry
148 time is in any format other than one number indicating the
149 number of seconds, it must be enclosed by double quotes.</p>
151 <p>If this directive is not used, cookies last only for the
152 current browser session.</p>
157 <name>CookieName</name>
158 <description>Name of the tracking cookie</description>
159 <syntax>CookieName <em>token</em></syntax>
160 <default>CookieName Apache</default>
162 <context>server config</context>
163 <context>virtual host</context>
164 <context>directory</context>
165 <context>.htaccess</context>
167 <override>FileInfo</override>
170 <p>This directive allows you to change the name of the cookie
171 this module uses for its tracking purposes. By default the
172 cookie is named "<code>Apache</code>".</p>
174 <p>You must specify a valid cookie name; results are
175 unpredictable if you use a name containing unusual characters.
176 Valid characters include A-Z, a-z, 0-9, "_", and "-".</p>
181 <name>CookieStyle</name>
182 <description>Format of the cookie header field</description>
184 <em>Netscape|Cookie|Cookie2|RFC2109|RFC2965</em></syntax>
185 <default>CookieStyle Netscape</default>
187 <context>server config</context>
188 <context>virtual host</context>
189 <context>directory</context>
190 <context>.htaccess</context>
192 <override>FileInfo</override>
195 <p>This directive controls the format of the cookie header
196 field. The three formats allowed are:</p>
199 <li><strong>Netscape</strong>, which is the original but now deprecated
200 syntax. This is the default, and the syntax Apache has
201 historically used.</li>
203 <li><strong>Cookie</strong> or <strong>RFC2109</strong>, which is the syntax that
204 superseded the Netscape syntax.</li>
206 <li><strong>Cookie2</strong> or <strong>RFC2965</strong>, which is the most
207 current cookie syntax.</li>
210 <p>Not all clients can understand all of these formats. but you
211 should use the newest one that is generally acceptable to your
219 <name>CookieTracking</name>
220 <description>Enables tracking cookie</description>
221 <syntax>CookieTracking on|off</syntax>
222 <default>CookieTracking off</default>
224 <context>server config</context>
225 <context>virtual host</context>
226 <context>directory</context>
227 <context>.htaccess</context>
229 <override>FileInfo</override>
232 <p>When the user track module is compiled in, and
233 "CookieTracking on" is set, Apache will start sending a
234 user-tracking cookie for all new requests. This directive can
235 be used to turn this behavior on or off on a per-server or
236 per-directory basis. By default, compiling mod_usertrack will
237 not activate cookies. </p>