2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
6 <name>mod_usertrack</name>
8 This module uses cookies to provide for a
9 <em>clickstream</em> log of user activity on a site.
11 <status>Extension</status>
12 <sourcefile>mod_usertrack.c</sourcefile>
13 <identifier>usertrack_module</identifier>
14 <compatibility>Known as mod_cookies prior to Apache 1.3.</compatibility>
17 <p>Previous releases of Apache have included a module which
18 generates a 'clickstream' log of user activity on a site using
19 cookies. This was called the "cookies" module, mod_cookies. In
20 Apache 1.2 and later this module has been renamed the "user
21 tracking" module, mod_usertrack. This module has been
22 simplified and new directives added.</p>
27 <title>Logging</title>
29 <p>Previously, the cookies module (now the user tracking
30 module) did its own logging, using the <directive>CookieLog</directive>
31 directive. In this release, this module does no logging at all.
32 Instead, a configurable log format file should be used to log
33 user click-streams. This is possible because the logging module
34 now allows multiple log files. The cookie itself is logged by
35 using the text <code>%{cookie}n</code> in the log file format. For
38 CustomLog logs/clickstream "%{cookie}n %r %t"
41 <p>For backward compatibility the configurable log module
42 implements the old <directive>CookieLog</directive> directive, but this
43 should be upgraded to the above <directive>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>controls the setting of the domain to which the tracking cookie applies.</description>
90 <syntax>CookieDomain <em>domain</em></syntax>
91 <default>None</default>
93 <context>server config</context>
94 <context>virtual host</context>
95 <context>directory</context>
96 <context>.htaccess</context>
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 <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></override>
123 <compatibility>In 1.3.20 and earlier, not usable in directory and
124 .htaccess</compatibility>
127 <p>When used, this directive sets an expiry time on the cookie
128 generated by the usertrack module. The <em>expiry-period</em>
129 can be given either as a number of seconds, or in the format
130 such as "2 weeks 3 days 7 hours". Valid denominations are:
131 years, months, weeks, hours, minutes and seconds. If the expiry
132 time is in any format other than one number indicating the
133 number of seconds, it must be enclosed by double quotes.</p>
135 <p>If this directive is not used, cookies last only for the
136 current browser session.</p>
141 <name>CookieName</name>
142 <syntax>CookieName <em>token</em></syntax>
143 <default>Apache</default>
145 <context>server config</context>
146 <context>virtual host</context>
147 <context>directory</context>
148 <context>.htaccess</context>
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>Controls the format of the cookie header field</description>
166 <em>Netscape|Cookie|Cookie2|RFC2109|RFC2965</em></syntax>
169 <context>server config</context>
170 <context>virtual host</context>
171 <context>directory</context>
172 <context>.htaccess</context>
176 <p>This directive controls the format of the cookie header
177 field. The three formats allowed are:</p>
180 <li><strong>Netscape</strong>, which is the original but now deprecated
181 syntax. This is the default, and the syntax Apache has
182 historically used.</li>
184 <li><strong>Cookie</strong> or <strong>RFC2109</strong>, which is the syntax that
185 superseded the Netscape syntax.</li>
187 <li><strong>Cookie2</strong> or <strong>RFC2965</strong>, which is the most
188 current cookie syntax.</li>
191 <p>Not all clients can understand all of these formats. but you
192 should use the newest one that is generally acceptable to your
200 <name>CookieTracking</name>
201 <syntax>CookieTracking on|off</syntax>
204 <context>server config</context>
205 <context>virtual host</context>
206 <context>directory</context>
207 <context>.htaccess</context>
209 <override>FileInfo</override>
212 <p>When the user track module is compiled in, and
213 "CookieTracking on" is set, Apache will start sending a
214 user-tracking cookie for all new requests. This directive can
215 be used to turn this behavior on or off on a per-server or
216 per-directory basis. By default, compiling mod_usertrack will
217 not activate cookies. </p>