Moved apache code into a folder to help prepare for packaging where we dont want...
[httpd-crcsyncproxy.git] / apache / docs / manual / mod / mod_usertrack.html.en
blobef1b2455973b02cc38876ba007f0b0e288209ca1
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5 This file is generated from xml source: DO NOT EDIT
6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7 -->
8 <title>mod_usertrack - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.3</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
19 <div id="path">
20 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_usertrack</h1>
23 <div class="toplang">
24 <p><span>Available Languages: </span><a href="../en/mod/mod_usertrack.html" title="English">&nbsp;en&nbsp;</a></p>
25 </div>
26 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>
27 <em>Clickstream</em> logging of user activity on a site
28 </td></tr>
29 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
30 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>usertrack_module</td></tr>
31 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_usertrack.c</td></tr></table>
32 <h3>Summary</h3>
34 <p>Previous releases of Apache have included a module which
35 generates a 'clickstream' log of user activity on a site using
36 cookies. This was called the "cookies" module, mod_cookies. In
37 Apache 1.2 and later this module has been renamed the "user
38 tracking" module, mod_usertrack. This module has been
39 simplified and new directives added.</p>
40 </div>
41 <div id="quickview"><h3 class="directives">Directives</h3>
42 <ul id="toc">
43 <li><img alt="" src="../images/down.gif" /> <a href="#cookiedomain">CookieDomain</a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#cookieexpires">CookieExpires</a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#cookiename">CookieName</a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#cookiestyle">CookieStyle</a></li>
47 <li><img alt="" src="../images/down.gif" /> <a href="#cookietracking">CookieTracking</a></li>
48 </ul>
49 <h3>Topics</h3>
50 <ul id="topics">
51 <li><img alt="" src="../images/down.gif" /> <a href="#logging">Logging</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#cookiedate">2-digit or 4-digit dates for cookies?</a></li>
53 </ul></div>
54 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
55 <div class="section">
56 <h2><a name="logging" id="logging">Logging</a></h2>
59 <p>Previously, the cookies module (now the user tracking
60 module) did its own logging, using the <code class="directive">CookieLog</code>
61 directive. In this release, this module does no logging at all.
62 Instead, a configurable log format file should be used to log
63 user click-streams. This is possible because the logging module
64 now allows multiple log files. The cookie itself is logged by
65 using the text <code>%{cookie}n</code> in the log file format. For
66 example:</p>
67 <div class="example"><p><code>
68 CustomLog logs/clickstream "%{cookie}n %r %t"
69 </code></p></div>
71 <p>For backward compatibility the configurable log module
72 implements the old <code class="directive"><a href="../mod/mod_log_config.html#cookielog">CookieLog</a></code> directive, but this
73 should be upgraded to the above <code class="directive"><a href="../mod/mod_log_config.html#customlog">CustomLog</a></code> directive. </p>
74 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
75 <div class="section">
76 <h2><a name="cookiedate" id="cookiedate">2-digit or 4-digit dates for cookies?</a></h2>
79 <p>(the following is from message
80 &lt;022701bda43d$9d32bbb0$1201a8c0@christian.office.sane.com&gt;
81 in the new-httpd archives) </p>
82 <pre>
83 From: "Christian Allen" &lt;christian@sane.com&gt;
84 Subject: Re: Apache Y2K bug in mod_usertrack.c
85 Date: Tue, 30 Jun 1998 11:41:56 -0400
87 Did some work with cookies and dug up some info that might be useful.
89 True, Netscape claims that the correct format NOW is four digit dates, and
90 four digit dates do in fact work... for Netscape 4.x (Communicator), that
91 is. However, 3.x and below do NOT accept them. It seems that Netscape
92 originally had a 2-digit standard, and then with all of the Y2K hype and
93 probably a few complaints, changed to a four digit date for Communicator.
94 Fortunately, 4.x also understands the 2-digit format, and so the best way to
95 ensure that your expiration date is legible to the client's browser is to
96 use 2-digit dates.
98 However, this does not limit expiration dates to the year 2000; if you use
99 an expiration year of "13", for example, it is interpreted as 2013, NOT
100 1913! In fact, you can use an expiration year of up to "37", and it will be
101 understood as "2037" by both MSIE and Netscape versions 3.x and up (not sure
102 about versions previous to those). Not sure why Netscape used that
103 particular year as its cut-off point, but my guess is that it was in respect
104 to UNIX's 2038 problem. Netscape/MSIE 4.x seem to be able to understand
105 2-digit years beyond that, at least until "50" for sure (I think they
106 understand up until about "70", but not for sure).
108 Summary: Mozilla 3.x and up understands two digit dates up until "37"
109 (2037). Mozilla 4.x understands up until at least "50" (2050) in 2-digit
110 form, but also understands 4-digit years, which can probably reach up until
111 9999. Your best bet for sending a long-life cookie is to send it for some
112 time late in the year "37".
113 </pre>
115 </div>
116 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
117 <div class="directive-section"><h2><a name="CookieDomain" id="CookieDomain">CookieDomain</a> <a name="cookiedomain" id="cookiedomain">Directive</a></h2>
118 <table class="directive">
119 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The domain to which the tracking cookie applies</td></tr>
120 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CookieDomain <em>domain</em></code></td></tr>
121 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
122 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
123 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
124 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_usertrack</td></tr>
125 </table>
127 <p>This directive controls the setting of the domain to which
128 the tracking cookie applies. If not present, no domain is
129 included in the cookie header field.</p>
131 <p>The domain string <strong>must</strong> begin with a dot, and
132 <strong>must</strong> include at least one embedded dot. That is,
133 <code>.example.com</code> is legal, but <code>foo.example.com</code> and
134 <code>.com</code> are not.</p>
136 <div class="note">Most browsers in use today will not allow cookies to be set
137 for a two-part top level domain, such as <code>.co.uk</code>,
138 although such a domain ostensibly fulfills the requirements
139 above.<br />
141 These domains are equivalent to top level domains such as
142 <code>.com</code>, and allowing such cookies may be a security
143 risk. Thus, if you are under a two-part top level domain, you
144 should still use your actual domain, as you would with any other top
145 level domain (for example <code>.foo.co.uk</code>).
146 </div>
148 </div>
149 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
150 <div class="directive-section"><h2><a name="CookieExpires" id="CookieExpires">CookieExpires</a> <a name="cookieexpires" id="cookieexpires">Directive</a></h2>
151 <table class="directive">
152 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Expiry time for the tracking cookie</td></tr>
153 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CookieExpires <em>expiry-period</em></code></td></tr>
154 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
155 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
156 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
157 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_usertrack</td></tr>
158 </table>
159 <p>When used, this directive sets an expiry time on the cookie
160 generated by the usertrack module. The <em>expiry-period</em>
161 can be given either as a number of seconds, or in the format
162 such as "2 weeks 3 days 7 hours". Valid denominations are:
163 years, months, weeks, days, hours, minutes and seconds. If the expiry
164 time is in any format other than one number indicating the
165 number of seconds, it must be enclosed by double quotes.</p>
167 <p>If this directive is not used, cookies last only for the
168 current browser session.</p>
170 </div>
171 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
172 <div class="directive-section"><h2><a name="CookieName" id="CookieName">CookieName</a> <a name="cookiename" id="cookiename">Directive</a></h2>
173 <table class="directive">
174 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the tracking cookie</td></tr>
175 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CookieName <em>token</em></code></td></tr>
176 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CookieName Apache</code></td></tr>
177 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
178 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
179 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
180 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_usertrack</td></tr>
181 </table>
182 <p>This directive allows you to change the name of the cookie
183 this module uses for its tracking purposes. By default the
184 cookie is named "<code>Apache</code>".</p>
186 <p>You must specify a valid cookie name; results are
187 unpredictable if you use a name containing unusual characters.
188 Valid characters include A-Z, a-z, 0-9, "_", and "-".</p>
190 </div>
191 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
192 <div class="directive-section"><h2><a name="CookieStyle" id="CookieStyle">CookieStyle</a> <a name="cookiestyle" id="cookiestyle">Directive</a></h2>
193 <table class="directive">
194 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Format of the cookie header field</td></tr>
195 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CookieStyle
196 <em>Netscape|Cookie|Cookie2|RFC2109|RFC2965</em></code></td></tr>
197 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CookieStyle Netscape</code></td></tr>
198 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
199 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
200 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
201 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_usertrack</td></tr>
202 </table>
203 <p>This directive controls the format of the cookie header
204 field. The three formats allowed are:</p>
206 <ul>
207 <li><strong>Netscape</strong>, which is the original but now deprecated
208 syntax. This is the default, and the syntax Apache has
209 historically used.</li>
211 <li><strong>Cookie</strong> or <strong>RFC2109</strong>, which is the syntax that
212 superseded the Netscape syntax.</li>
214 <li><strong>Cookie2</strong> or <strong>RFC2965</strong>, which is the most
215 current cookie syntax.</li>
216 </ul>
218 <p>Not all clients can understand all of these formats. but you
219 should use the newest one that is generally acceptable to your
220 users' browsers. At the time of writing, most browsers only fully
221 support <code>CookieStyle Netscape</code>.</p>
223 </div>
224 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
225 <div class="directive-section"><h2><a name="CookieTracking" id="CookieTracking">CookieTracking</a> <a name="cookietracking" id="cookietracking">Directive</a></h2>
226 <table class="directive">
227 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables tracking cookie</td></tr>
228 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CookieTracking on|off</code></td></tr>
229 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CookieTracking off</code></td></tr>
230 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
231 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
232 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
233 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_usertrack</td></tr>
234 </table>
235 <p>When <code class="module"><a href="../mod/mod_usertrack.html">mod_usertrack</a></code> is loaded, and
236 <code>CookieTracking on</code> is set, Apache will send a
237 user-tracking cookie for all new requests. This directive can
238 be used to turn this behavior on or off on a per-server or
239 per-directory basis. By default, enabling
240 <code class="module"><a href="../mod/mod_usertrack.html">mod_usertrack</a></code> will <strong>not</strong>
241 activate cookies. </p>
244 </div>
245 </div>
246 <div class="bottomlang">
247 <p><span>Available Languages: </span><a href="../en/mod/mod_usertrack.html" title="English">&nbsp;en&nbsp;</a></p>
248 </div><div id="footer">
249 <p class="apache">Copyright 2009 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
250 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
251 </body></html>