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