]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_usertrack.xml
update license header text
[apache] / docs / manual / mod / mod_usertrack.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
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.
21 -->
22
23 <modulesynopsis metafile="mod_usertrack.xml.meta">
24 <name>mod_usertrack</name>
25 <description>
26 <em>Clickstream</em> logging of user activity on a site
27 </description>
28 <status>Extension</status>
29 <sourcefile>mod_usertrack.c</sourcefile>
30 <identifier>usertrack_module</identifier>
31
32 <summary>
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>
39 </summary>
40
41
42 <section id="logging">
43 <title>Logging</title>
44
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
52     example:</p>
53 <example>
54 CustomLog logs/clickstream "%{cookie}n %r %t"
55 </example>
56
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>
62 </section>
63
64 <section id="cookiedate">
65 <title>2-digit or 4-digit dates for cookies?</title>
66
67     <p>(the following is from message
68     &lt;022701bda43d$9d32bbb0$1201a8c0@christian.office.sane.com&gt;
69     in the new-httpd archives) </p>
70 <pre>
71 From: "Christian Allen" &lt;christian@sane.com&gt;
72 Subject: Re: Apache Y2K bug in mod_usertrack.c
73 Date: Tue, 30 Jun 1998 11:41:56 -0400
74
75 Did some work with cookies and dug up some info that might be useful.
76
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
84 use 2-digit dates.
85
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).
95
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".
101 </pre>
102
103 </section>
104
105 <directivesynopsis>
106 <name>CookieDomain</name>
107 <description>The domain to which the tracking cookie applies</description>
108 <syntax>CookieDomain <em>domain</em></syntax>
109 <contextlist>
110 <context>server config</context>
111 <context>virtual host</context>
112 <context>directory</context>
113 <context>.htaccess</context>
114 </contextlist>
115 <override>FileInfo</override>
116
117 <usage>
118
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>
122
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     <code>.foo.com</code> is legal, but <code>foo.bar.com</code> and 
126     <code>.com</code> are not.</p>
127
128     <note>Most browsers in use today will not allow cookies to be set
129     for a two-part top level domain, such as <code>.co.uk</code>, 
130     although such a domain ostensibly fulfills the requirements
131     above.<br /> 
132     
133     These domains are equivalent to top level domains such as
134     <code>.com</code>, and allowing such cookies may be a security
135     risk. Thus, if you are under a two-part top level domain, you
136     should still use your actual domain, as you would with any other top
137     level domain (for example <code>.foo.co.uk</code>).
138     </note> 
139             
140 </usage>
141 </directivesynopsis>
142
143
144 <directivesynopsis>
145 <name>CookieExpires</name>
146 <description>Expiry time for the tracking cookie</description>
147 <syntax>CookieExpires <em>expiry-period</em></syntax>
148 <contextlist>
149 <context>server config</context>
150 <context>virtual host</context>
151 <context>directory</context>
152 <context>.htaccess</context>
153 </contextlist>
154 <override>FileInfo</override>
155
156 <usage>
157     <p>When used, this directive sets an expiry time on the cookie
158     generated by the usertrack module. The <em>expiry-period</em>
159     can be given either as a number of seconds, or in the format
160     such as "2 weeks 3 days 7 hours". Valid denominations are:
161     years, months, weeks, days, hours, minutes and seconds. If the expiry
162     time is in any format other than one number indicating the
163     number of seconds, it must be enclosed by double quotes.</p>
164
165     <p>If this directive is not used, cookies last only for the
166     current browser session.</p>
167 </usage>
168 </directivesynopsis>
169
170 <directivesynopsis>
171 <name>CookieName</name>
172 <description>Name of the tracking cookie</description>
173 <syntax>CookieName <em>token</em></syntax>
174 <default>CookieName Apache</default>
175 <contextlist>
176 <context>server config</context>
177 <context>virtual host</context>
178 <context>directory</context>
179 <context>.htaccess</context>
180 </contextlist>
181 <override>FileInfo</override>
182
183 <usage>
184     <p>This directive allows you to change the name of the cookie
185     this module uses for its tracking purposes. By default the
186     cookie is named "<code>Apache</code>".</p>
187
188     <p>You must specify a valid cookie name; results are
189     unpredictable if you use a name containing unusual characters.
190     Valid characters include A-Z, a-z, 0-9, "_", and "-".</p>
191 </usage>
192 </directivesynopsis>
193
194 <directivesynopsis>
195 <name>CookieStyle</name>
196 <description>Format of the cookie header field</description>
197 <syntax>CookieStyle
198     <em>Netscape|Cookie|Cookie2|RFC2109|RFC2965</em></syntax>
199 <default>CookieStyle Netscape</default>
200 <contextlist>
201 <context>server config</context>
202 <context>virtual host</context>
203 <context>directory</context>
204 <context>.htaccess</context>
205 </contextlist>
206 <override>FileInfo</override>
207
208 <usage>
209     <p>This directive controls the format of the cookie header
210     field. The three formats allowed are:</p>
211
212     <ul>
213       <li><strong>Netscape</strong>, which is the original but now deprecated
214       syntax. This is the default, and the syntax Apache has
215       historically used.</li>
216
217       <li><strong>Cookie</strong> or <strong>RFC2109</strong>, which is the syntax that
218       superseded the Netscape syntax.</li>
219
220       <li><strong>Cookie2</strong> or <strong>RFC2965</strong>, which is the most
221       current cookie syntax.</li>
222     </ul>
223
224     <p>Not all clients can understand all of these formats. but you
225     should use the newest one that is generally acceptable to your
226     users' browsers. At the time of writing, most browsers only fully
227     support <code>CookieStyle Netscape</code>.</p>
228 </usage>
229 </directivesynopsis>
230
231
232
233 <directivesynopsis>
234 <name>CookieTracking</name>
235 <description>Enables tracking cookie</description>
236 <syntax>CookieTracking on|off</syntax>
237 <default>CookieTracking off</default>
238 <contextlist>
239 <context>server config</context>
240 <context>virtual host</context>
241 <context>directory</context>
242 <context>.htaccess</context>
243 </contextlist>
244 <override>FileInfo</override>
245
246 <usage>
247     <p>When <module>mod_usertrack</module> is loaded, and
248     <code>CookieTracking on</code> is set, Apache will send a
249     user-tracking cookie for all new requests. This directive can
250     be used to turn this behavior on or off on a per-server or
251     per-directory basis. By default, enabling
252     <module>mod_usertrack</module> will <strong>not</strong> 
253     activate cookies. </p>
254
255 </usage>
256 </directivesynopsis>
257
258 </modulesynopsis>