mod_usertrack.html revision e0b181d3bfa99dfb992df3024b397660cb7afbe9
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder<html xmlns="http://www.w3.org/TR/xhtml1/strict"><head><!--
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder This file is generated from xml source: DO NOT EDIT
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder --><title>mod_usertrack- Apache HTTP Server</title><link rel="stylesheet" type="text/css" href="/style/manual.css"/></head><body><blockquote><div align="center"><img src="/images/sub.gif" alt="[APACHE DOCUMENTATION]"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mod_usertrack</h1><table bgcolor="#cccccc" cellpadding="0" cellspacing="1"><tr><td><table bgcolor="#ffffff"><tr><td valign="top"><span class="help">Description:</span></td><td>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder This module uses cookies to provide for a
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <em>clickstream</em> log of user activity on a site.
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder</td></tr><tr><td><a class="help" href="module-dict.html#Status">Status:</a></td><td>Extension</td></tr><tr><td><a class="help" href="module-dict.html#ModuleIdentifier">Module&nbsp;Identifier:</a></td><td>usertrack_module</td></tr><tr><td valign="top" align="left"><a class="help" href="module-dict.html#Compatibility">Compatibility:</a></td><td><compatibility>Known as mod_cookies prior to Apache 1.3.</compatibility></td></tr></table></td></tr></table><h2>Summary</h2>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <p>Previous releases of Apache have included a module which
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder generates a 'clickstream' log of user activity on a site using
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder cookies. This was called the "cookies" module, mod_cookies. In
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder Apache 1.2 and later this module has been renamed the "user
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder tracking" module, mod_usertrack. This module has been
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder simplified and new directives added.</p>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder<h2>Directives</h2><ul><li><a href="#cookiedomain">CookieDomain</a></li><li><a href="#cookieexpires">CookieExpires</a></li><li><a href="#cookiename">CookieName</a></li><li><a href="#cookiestyle">CookieStyle</a></li><li><a href="#cookietracking">CookieTracking</a></li></ul><h2>Logging</h2>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <p>Previously, the cookies module (now the user tracking
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder module) did its own logging, using the <code class="directive">CookieLog</code>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder directive. In this release, this module does no logging at all.
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder Instead, a configurable log format file should be used to log
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder user click-streams. This is possible because the logging module
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder now allows multiple log files. The cookie itself is logged by
18de8303d920c928b56f4c887dcb589db941f500Christian Maeder using the text <code>%{cookie}n</code> in the log file format. For
22f975b89b9c0934a8bc62aa328809e1cbb2a203Christian Maeder example:</p>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian MaederCustomLog logs/clickstream "%{cookie}n %r %t"
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder</code></td></tr></table></blockquote>
f9e0b18852b238ddb649d341194e05d7200d1bbeChristian Maeder
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <p>For backward compatibility the configurable log module
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder implements the old <code class="directive">CookieLog</code> directive, but this
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder should be upgraded to the above <code class="directive">CustomLog</code> directive. </p>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder<h2>2-digit or 4-digit dates for cookies?</h2>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <p>(the following is from message
3aad1a996180e6888430cbdf5b1272a14fa89c16Mihai Codescu &lt;022701bda43d$9d32bbb0$1201a8c0@christian.office.sane.com&gt;
3aad1a996180e6888430cbdf5b1272a14fa89c16Mihai Codescu in the new-httpd archives) </p>
3aad1a996180e6888430cbdf5b1272a14fa89c16Mihai Codescu<pre>
3aad1a996180e6888430cbdf5b1272a14fa89c16Mihai CodescuFrom: "Christian Allen" &lt;christian@sane.com&gt;
3aad1a996180e6888430cbdf5b1272a14fa89c16Mihai CodescuSubject: Re: Apache Y2K bug in mod_usertrack.c
12368e292c1abf7eaf975f20ee30ef7820ac5dd5Christian MaederDate: Tue, 30 Jun 1998 11:41:56 -0400
18de8303d920c928b56f4c887dcb589db941f500Christian Maeder
3e8b136f23ed57d40ee617f49bcac37830b58cabChristian MaederDid some work with cookies and dug up some info that might be useful.
12368e292c1abf7eaf975f20ee30ef7820ac5dd5Christian Maeder
12368e292c1abf7eaf975f20ee30ef7820ac5dd5Christian MaederTrue, Netscape claims that the correct format NOW is four digit dates, and
12368e292c1abf7eaf975f20ee30ef7820ac5dd5Christian Maederfour digit dates do in fact work... for Netscape 4.x (Communicator), that
12368e292c1abf7eaf975f20ee30ef7820ac5dd5Christian Maederis. However, 3.x and below do NOT accept them. It seems that Netscape
8e1709b00329db7fc8d2e9e97ba92eef098c0584Christian Maederoriginally had a 2-digit standard, and then with all of the Y2K hype and
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maederprobably a few complaints, changed to a four digit date for Communicator.
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian MaederFortunately, 4.x also understands the 2-digit format, and so the best way to
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maederensure that your expiration date is legible to the client's browser is to
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maederuse 2-digit dates.
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder
8e1709b00329db7fc8d2e9e97ba92eef098c0584Christian MaederHowever, this does not limit expiration dates to the year 2000; if you use
8e1709b00329db7fc8d2e9e97ba92eef098c0584Christian Maederan expiration year of "13", for example, it is interpreted as 2013, NOT
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder1913! In fact, you can use an expiration year of up to "37", and it will be
12368e292c1abf7eaf975f20ee30ef7820ac5dd5Christian Maederunderstood as "2037" by both MSIE and Netscape versions 3.x and up (not sure
8e1709b00329db7fc8d2e9e97ba92eef098c0584Christian Maederabout versions previous to those). Not sure why Netscape used that
12368e292c1abf7eaf975f20ee30ef7820ac5dd5Christian Maederparticular year as its cut-off point, but my guess is that it was in respect
e7b5c0df35a6c913170d892bb601298bc141b824Christian Maederto UNIX's 2038 problem. Netscape/MSIE 4.x seem to be able to understand
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder2-digit years beyond that, at least until "50" for sure (I think they
12368e292c1abf7eaf975f20ee30ef7820ac5dd5Christian Maederunderstand up until about "70", but not for sure).
da955132262baab309a50fdffe228c9efe68251dCui Jian
68744e8ea95b6a93f57097f2912c6d16d3745809Cui JianSummary: Mozilla 3.x and up understands two digit dates up until "37"
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder(2037). Mozilla 4.x understands up until at least "50" (2050) in 2-digit
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maederform, but also understands 4-digit years, which can probably reach up until
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder9999. Your best bet for sending a long-life cookie is to send it for some
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maedertime late in the year "37".
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder</pre>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder<hr/><h2><a name="CookieDomain">CookieDomain</a> <a name="cookiedomain">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>controls the setting of the domain to which the tracking cookie applies.</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>CookieDomain <em>domain</em></td></tr><tr><td><a class="help" href="directive-dict.html#Default">Default:</a></td><td><code>None</code></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Extension</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_usertrack</td></tr></table></td></tr></table>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <p>This directive controls the setting of the domain to which
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder the tracking cookie applies. If not present, no domain is
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder included in the cookie header field.</p>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder
12368e292c1abf7eaf975f20ee30ef7820ac5dd5Christian Maeder <p>The domain string <strong>must</strong> begin with a dot, and
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <strong>must</strong> include at least one embedded dot. That is,
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder ".foo.com" is legal, but "foo.bar.com" and ".com" are not.</p>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder<hr/><h2><a name="CookieExpires">CookieExpires</a> <a name="cookieexpires">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td/></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>CookieExpires <em>expiry-period</em></td></tr><tr><td><a class="help" href="directive-dict.html#Default">Default:</a></td><td><code/></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a class="help" href="directive-dict.html#Override">Override:</a></td><td/></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Extension</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_usertrack</td></tr><tr><td valign="top" align="left"><a class="help" href="directive-dict.html#Compatibility">Compatibility:</a></td><td>In 1.3.20 and earlier, not usable in directory and
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder.htaccess</td></tr></table></td></tr></table>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <p>When used, this directive sets an expiry time on the cookie
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder generated by the usertrack module. The <em>expiry-period</em>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder can be given either as a number of seconds, or in the format
cb2d1be63cb09870640315f2aa4632dcad2c6360Christian Maeder such as "2 weeks 3 days 7 hours". Valid denominations are:
22f975b89b9c0934a8bc62aa328809e1cbb2a203Christian Maeder years, months, weeks, hours, minutes and seconds. If the expiry
cb2d1be63cb09870640315f2aa4632dcad2c6360Christian Maeder time is in any format other than one number indicating the
22f975b89b9c0934a8bc62aa328809e1cbb2a203Christian Maeder number of seconds, it must be enclosed by double quotes.</p>
22f975b89b9c0934a8bc62aa328809e1cbb2a203Christian Maeder
cb2d1be63cb09870640315f2aa4632dcad2c6360Christian Maeder <p>If this directive is not used, cookies last only for the
22f975b89b9c0934a8bc62aa328809e1cbb2a203Christian Maeder current browser session.</p>
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder<hr/><h2><a name="CookieName">CookieName</a> <a name="cookiename">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td/></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>CookieName <em>token</em></td></tr><tr><td><a class="help" href="directive-dict.html#Default">Default:</a></td><td><code>Apache</code></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Extension</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_usertrack</td></tr></table></td></tr></table>
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder <p>This directive allows you to change the name of the cookie
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder this module uses for its tracking purposes. By default the
c43270ad64272b1509c4c29645136c269dae7c9eChristian Maeder cookie is named "<code>Apache</code>".</p>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <p>You must specify a valid cookie name; results are
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder unpredictable if you use a name containing unusual characters.
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder Valid characters include A-Z, a-z, 0-9, "_", and "-".</p>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder<hr/><h2><a name="CookieStyle">CookieStyle</a> <a name="cookiestyle">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Controls the format of the cookie header field</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>CookieStyle
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <em>Netscape|Cookie|Cookie2|RFC2109|RFC2965</em></td></tr><tr><td><a class="help" href="directive-dict.html#Default">Default:</a></td><td><code/></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Extension</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_usertrack</td></tr></table></td></tr></table>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <p>This directive controls the format of the cookie header
80d0480a60b409d9cf256d0a6c411dd99c672124Christian Maeder field. The three formats allowed are:</p>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <ul>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <li><strong>Netscape</strong>, which is the original but now deprecated
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder syntax. This is the default, and the syntax Apache has
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder historically used.</li>
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder <li><strong>Cookie</strong> or <strong>RFC2109</strong>, which is the syntax that
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder superseded the Netscape syntax.</li>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <li><strong>Cookie2</strong> or <strong>RFC2965</strong>, which is the most
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder current cookie syntax.</li>
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder </ul>
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder <p>Not all clients can understand all of these formats. but you
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder should use the newest one that is generally acceptable to your
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder users' browsers.</p>
e7b5c0df35a6c913170d892bb601298bc141b824Christian Maeder<hr/><h2><a name="CookieTracking">CookieTracking</a> <a name="cookietracking">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td/></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>CookieTracking on|off</td></tr><tr><td><a class="help" href="directive-dict.html#Default">Default:</a></td><td><code/></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a class="help" href="directive-dict.html#Override">Override:</a></td><td>FileInfo</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Extension</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_usertrack</td></tr></table></td></tr></table>
e7b5c0df35a6c913170d892bb601298bc141b824Christian Maeder <p>When the user track module is compiled in, and
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder "CookieTracking on" is set, Apache will start sending a
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder user-tracking cookie for all new requests. This directive can
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder be used to turn this behavior on or off on a per-server or
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder per-directory basis. By default, compiling mod_usertrack will
453901d7ab77307fdb3ccae9bf19ed44802c6e44Christian Maeder not activate cookies. </p>
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder<hr/></blockquote><h3 align="center">Apache HTTP Server Version 2.0</h3><a href="./"><img src="/images/index.gif" alt="Index"/></a><a href="../"><img src="/images/home.gif" alt="Home"/></a></body></html>