mod_usertrack.html revision 4fd6f3be2a0c9157cbed90d08b18d38813e3cfbc
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<HTML>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<HEAD>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<TITLE>Apache module mod_usertrack</TITLE>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin</HEAD>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<BODY
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin BGCOLOR="#FFFFFF"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin TEXT="#000000"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin LINK="#0000FF"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin VLINK="#000080"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ALINK="#FF0000"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<!--#include virtual="header.html" -->
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<H1 ALIGN="CENTER">Module mod_usertrack</H1>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<p>This module uses cookies to provide for a <em>clickstream</em> log of user
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinactivity on a site.</p>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<P><A
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinHREF="module-dict.html#Status"
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. FaulknerREL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Status:</STRONG></A> Extension
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinHREF="module-dict.html#SourceFile"
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinREL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Source File:</STRONG></A> mod_usertrack.c
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinHREF="module-dict.html#ModuleIdentifier"
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland MainzREL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Module Identifier:</STRONG></A> usertrack_module
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinHREF="module-dict.html#Compatibility"
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. FaulknerREL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Compatibility:</STRONG></A> Known as mod_cookies prior to
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinApache 1.3.
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin</P>
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland Mainz
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland Mainz<h2>Summary</h2>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<p>Previous releases of Apache have included a module which generates a
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin'clickstream' log of user activity on a site using cookies. This was
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chincalled the "cookies" module, mod_cookies. In Apache 1.2 and later this
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinmodule has been renamed the "user tracking" module,
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinmod_usertrack. This module has been simplified and new directives
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland Mainzadded.</p>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<H2>Directives</H2>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<UL>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<LI><A HREF="#cookieexpires">CookieExpires</A>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<LI><A HREF="#cookiename">CookieName</A>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<LI><A HREF="#cookietracking">CookieTracking</A>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin</UL>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<H2>Logging</H2>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<p>Previously, the cookies module (now the user tracking module) did its
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinown logging, using the <TT>CookieLog</TT> directive. In this release,
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinthis module does no logging at all. Instead, a configurable log
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinformat file should be used to log user click-streams. This is possible
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinbecause the logging module allows multiple log files. The cookie itself is
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinlogged by using the text <TT>%{cookie}n </TT>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinin the log file format. For example:
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<PRE>
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinCustomLog logs/clickstream "%{cookie}n %r %t"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin</PRE>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinFor backward compatibility the configurable log module implements the
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinold <TT>CookieLog</TT> directive, but this should be upgraded to the
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinabove <TT>CustomLog</TT> directive.
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<H2>2-digit or 4-digit dates for cookies?</H2>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin(the following is from message
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin&lt;022701bda43d$9d32bbb0$1201a8c0@christian.office.sane.com&gt; in
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinthe new-httpd archives)
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<P>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<PRE>
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinFrom: "Christian Allen" &lt;christian@sane.com&gt;
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinSubject: Re: Apache Y2K bug in mod_usertrack.c
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinDate: Tue, 30 Jun 1998 11:41:56 -0400
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinDid some work with cookies and dug up some info that might be useful.
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinTrue, Netscape claims that the correct format NOW is four digit dates, and
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinfour digit dates do in fact work... for Netscape 4.x (Communicator), that
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinis. However, 3.x and below do NOT accept them. It seems that Netscape
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinoriginally had a 2-digit standard, and then with all of the Y2K hype and
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinprobably a few complaints, changed to a four digit date for Communicator.
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinFortunately, 4.x also understands the 2-digit format, and so the best way to
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinensure that your expiration date is legible to the client's browser is to
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinuse 2-digit dates.
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinHowever, this does not limit expiration dates to the year 2000; if you use
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinan expiration year of "13", for example, it is interpreted as 2013, NOT
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin1913! In fact, you can use an expiration year of up to "37", and it will be
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinunderstood as "2037" by both MSIE and Netscape versions 3.x and up (not sure
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinabout versions previous to those). Not sure why Netscape used that
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinparticular year as its cut-off point, but my guess is that it was in respect
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinto UNIX's 2038 problem. Netscape/MSIE 4.x seem to be able to understand
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin2-digit years beyond that, at least until "50" for sure (I think they
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinunderstand up until about "70", but not for sure).
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinSummary: Mozilla 3.x and up understands two digit dates up until "37"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin(2037). Mozilla 4.x understands up until at least "50" (2050) in 2-digit
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinform, but also understands 4-digit years, which can probably reach up until
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin9999. Your best bet for sending a long-life cookie is to send it for some
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chintime late in the year "37".
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin</PRE>
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland Mainz
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<HR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<H2><A NAME="cookieexpires">CookieExpires</A> directive</H2>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Syntax"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Syntax:</STRONG></A> CookieExpires <EM>expiry-period</EM><BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Context"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Context:</STRONG></A> server config, virtual host<BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Status"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Status:</STRONG></A> optional<BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Module"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Module:</STRONG></A> mod_usertrack<P>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinWhen used, this directive sets an expiry time on the cookie generated
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinby the usertrack module. The <EM>expiry-period</EM> can be given either
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinas a number of seconds, or in the format such as "2 weeks 3 days 7
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinhours". Valid denominations are: years, months, weeks, hours, minutes
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinand seconds. If the expiry time is in any format other than one
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinnumber indicating the number of seconds, it must be enclosed by
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chindouble quotes.
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<P>If this directive is not used, cookies last only for the current
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinbrowser session.</P>
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland Mainz
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<HR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<H2><A NAME="cookiename">CookieName</A> directive</H2>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Syntax"
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland Mainz REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Syntax:</STRONG></A> CookieName <EM>token</EM>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Default"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Default:</STRONG></A> <EM>Apache</EM>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Context"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Context:</STRONG></A> server config, virtual host, directory,
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin.htaccess<BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Status"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Status:</STRONG></A> optional<BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Module"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Module:</STRONG></A> mod_usertrack
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Compatibility"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Compatibility:</STRONG></A> Apache 1.3.7 and later
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<P>
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinThis directive allows you to change the name of the cookie this module
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinuses for its tracking purposes. By default the cookie is named
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin"<CODE>Apache</CODE>".
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin</P>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<P>
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinYou must specify a valid cookie name; results are unpredictable if
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinyou use a name containing unusual characters. Valid characters
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chininclude A-Z, a-z, 0-9, "_", and "-".
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin</P>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<hr>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<H2><A NAME="cookietracking">CookieTracking</A> directive</H2>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Syntax"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Syntax:</STRONG></A> CookieTracking <EM>on | off</EM><BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Context"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Context:</STRONG></A> server config, virtual host, directory,
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin.htaccess<BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Override"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Override:</STRONG></A> FileInfo<BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Status"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Status:</STRONG></A> optional<BR>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<A
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin HREF="directive-dict.html#Module"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin REL="Help"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin><STRONG>Module:</STRONG></A> mod_usertrack<P>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinWhen the user track module is compiled in, and "CookieTracking on" is
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinset, Apache will start sending a user-tracking cookie for all new
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinrequests. This directive can be used to turn this behavior on or off
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinon a per-server or per-directory basis. By default, compiling
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinmod_usertrack will not activate cookies.
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin<!--#include virtual="footer.html" -->
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin</BODY>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin</HTML>
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin