]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_usertrack.html
ee4ba182c126b720e6d0f712878e94b5ded32ad9
[apache] / docs / manual / mod / mod_usertrack.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>Apache module mod_usertrack</TITLE>
5 </HEAD>
6
7 <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
8 <BODY
9  BGCOLOR="#FFFFFF"
10  TEXT="#000000"
11  LINK="#0000FF"
12  VLINK="#000080"
13  ALINK="#FF0000"
14 >
15 <!--#include virtual="header.html" -->
16 <H1 ALIGN="CENTER">Module mod_usertrack</H1>
17
18 Previous releases of Apache have included a module which generates a
19 'clickstream' log of user activity on a site using cookies. This was
20 called the "cookies" module, mod_cookies. In Apache 1.2 and later this
21 module has been renamed the "user tracking" module,
22 mod_usertrack. This module has been simplified and new directives
23 added.
24
25 <HR>
26
27 <H2>Logging</H2>
28
29 Previously, the cookies module (now the user tracking module) did its
30 own logging, using the <TT>CookieLog</TT> directive. In this release,
31 this module does no logging at all. Instead, a configurable log
32 format file should be used to log user click-streams. This is possible
33 because the logging module now allows <A
34 HREF="../multilogs.html">multiple log files</A>. The cookie itself is
35 logged by using the text <TT>%{cookie}n </TT>
36
37 in the log file format. For example:
38 <PRE>
39 CustomLog logs/clickstream "%{cookie}n %r %t"
40 </PRE>
41
42 For backward compatibility the configurable log module implements the
43 old <TT>CookieLog</TT> directive, but this should be upgraded to the
44 above <TT>CustomLog</TT> directive.
45
46 <H2>Directives</H2>
47
48 <UL>
49 <LI><A HREF="#cookieexpires">CookieExpires</A>
50 <LI><A HREF="#cookietracking">CookieTracking</A>
51 </UL>
52
53 <HR>
54
55 <H2><A NAME="cookieexpires">CookieExpires</A></H2>
56 <A
57  HREF="directive-dict.html#Syntax"
58  REL="Help"
59 ><STRONG>Syntax:</STRONG></A> CookieExpires <EM>expiry-period</EM><BR>
60 <A
61  HREF="directive-dict.html#Context"
62  REL="Help"
63 ><STRONG>Context:</STRONG></A> server config, virtual host<BR>
64 <A
65  HREF="directive-dict.html#Status"
66  REL="Help"
67 ><STRONG>Status:</STRONG></A> optional<BR>
68 <A
69  HREF="directive-dict.html#Module"
70  REL="Help"
71 ><STRONG>Module:</STRONG></A> mod_usertrack<P>
72
73 When used, this directive sets an expiry time on the cookie generated
74 by the usertrack module. The <EM>expiry-period</EM> can be given either
75 as a number of seconds, or in the format such as "2 weeks 3 days 7
76 hours".  Valid denominations are: years, months, weeks, hours, minutes
77 and seconds.  If the expiry time is in any format other than one
78 number indicating the number of seconds, it must be enclosed by
79 double quotes.
80
81 <P>If this directive is not used, cookies last only for the current
82 browser session.</P>
83
84 <H2><A NAME="cookietracking">CookieTracking</A></H2>
85 <A
86  HREF="directive-dict.html#Syntax"
87  REL="Help"
88 ><STRONG>Syntax:</STRONG></A> CookieTracking <EM>on | off</EM><BR>
89 <A
90  HREF="directive-dict.html#Context"
91  REL="Help"
92 ><STRONG>Context:</STRONG></A> server config, virtual host, directory,
93 .htaccess<BR>
94 <A
95  HREF="directive-dict.html#Override"
96  REL="Help"
97 ><STRONG>Override:</STRONG></A> FileInfo<BR>
98 <A
99  HREF="directive-dict.html#Status"
100  REL="Help"
101 ><STRONG>Status:</STRONG></A> optional<BR>
102 <A
103  HREF="directive-dict.html#Module"
104  REL="Help"
105 ><STRONG>Module:</STRONG></A> mod_usertrack<P>
106
107 When the user track module is compiled in, and "CookieTracking on" is
108 set, Apache will start sending a user-tracking cookie for all new
109 requests. This directive can be used to turn this behavior on or off
110 on a per-server or per-directory basis.  By default, compiling
111 mod_usertrack will not activate cookies.
112
113 <HR>
114
115 <H2>2-digit or 4-digit dates for cookies?</H2>
116
117 (the following is from message
118 &lt;022701bda43d$9d32bbb0$1201a8c0@christian.office.sane.com&gt; in
119 the new-httpd archives)
120
121 <P>
122
123 <PRE>
124 From: "Christian Allen" &lt;christian@sane.com&gt;
125 Subject: Re: Apache Y2K bug in mod_usertrack.c
126 Date: Tue, 30 Jun 1998 11:41:56 -0400
127
128 Did some work with cookies and dug up some info that might be useful.
129
130 True, Netscape claims that the correct format NOW is four digit dates, and
131 four digit dates do in fact work... for Netscape 4.x (Communicator), that
132 is.  However, 3.x and below do NOT accept them.  It seems that Netscape
133 originally had a 2-digit standard, and then with all of the Y2K hype and
134 probably a few complaints, changed to a four digit date for Communicator.
135 Fortunately, 4.x also understands the 2-digit format, and so the best way to
136 ensure that your expiration date is legible to the client's browser is to
137 use 2-digit dates.
138
139 However, this does not limit expiration dates to the year 2000; if you use
140 an expiration year of "13", for example, it is interpreted as 2013, NOT
141 1913!  In fact, you can use an expiration year of up to "37", and it will be
142 understood as "2037" by both MSIE and Netscape versions 3.x and up (not sure
143 about versions previous to those).  Not sure why Netscape used that
144 particular year as its cut-off point, but my guess is that it was in respect
145 to UNIX's 2038 problem.  Netscape/MSIE 4.x seem to be able to understand
146 2-digit years beyond that, at least until "50" for sure (I think they
147 understand up until about "70", but not for sure).
148
149 Summary:  Mozilla 3.x and up understands two digit dates up until "37"
150 (2037).  Mozilla 4.x understands up until at least "50" (2050) in 2-digit
151 form, but also understands 4-digit years, which can probably reach up until
152 9999.  Your best bet for sending a long-life cookie is to send it for some
153 time late in the year "37".
154 </PRE>
155
156 <!--#include virtual="footer.html" -->
157 </BODY>
158 </HTML>