Session Tracking With Apache Page 4

執筆者
Martin Brown
Martin Brown
Published: Jul 20, 2010
Updated: Nov 10, 2020
3 minute read
ServerWatch のコンテンツおよび製品のおすすめは、編集上の独立性を保っています。パートナーへのリンクをクリックすると、当社が報酬を得る場合があります。 詳細を見る



Dynamic Solutions

If you are developing a dynamic site (i.e., using PHP, Perl, or Java), then the mod_usertrack module will not be very useful. This is because much of the site’s functionality may be embedded into the dynamic components. This can make the limited output mod_usertrack provides useless because the form elements and components are not stored in the logs.

Also, it’s highly likely that your dynamic solution may already be using some kind of user session tracking tool that can help provide the sought-after information. The fewer cookies supplied to a client, the less likely users will be over-conscious of the information stored, and will thus be more likely to use the site.

Table of Contents
Tracking Progress
Adding mod_usertrack to Your Apache Installation
Enabling Tracking
Choosing an Expiry Time
Configuring the Log
Analyzing the Results
Dynamic Solutions
The Performance Trade Off

How information is logged and tracked is entirely up to you, but for the most part it depends on the type of site created and how the information is monitored. For simple monitoring, we recommend a very simple log that generates simple sentences like this (obviously with each session ID appended to each line):

User searched for books with 'Apache' in the title
User viewed the book 'Pro Apache' User added the book 'Pro Apache' 
   to their basket
User viewed basket

Although simplistic, it has the benefit of being very readable, while not permitting easy summary processing. For example, when using this method it is difficult to see how many people searched for books with ‘Apache’ without doing some more extensive text processing. When that level of detail is needed, write the information to a database in a rigid format, like so:

Tracking More Data

SessionIDOperationParameterID
98374SearchApache 
98374View 3475
98374Buy 3475
98374ViewBasket  

As the contents of this table illustrate, it would be possible to obtain the number of times a page for a particular book was viewed and the book was purchased, and how frequently various search terms were used. This is how, for example, Amazon.com is able to provide a user with ‘recommended’ titles.

The Performance Trade Off

Regardless of whether you use mod_usertrack or a system embedded into your dynamically driven site, there will be some performance trade offs. The trade off comes at a number of levels, but just the act of exchanging cookie data and looking up cookie information between browser requests is time consuming, not to mention the overhead of writing the information to a log file or database.

This will present an issue (if only a small one), however you look at it, and deciding whether to go ahead will rely entirely on how much value there is in the information and how much of a trade off you are willing to make between the value of that information and the effect on your site.

Advertisement

Generally, for dynamic sites, the extra information gained — especially if that information is used to help guide the user to other products or items he may be interested in — is significant. Most dynamic sites are already reading and writing to databases or files, so one more will not hurt.

Martin Brown

Martin Brown is a ServerWatch contributor.

ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

TechnologyAdvice が所有・運営しています。 © 2026 TechnologyAdvice. 無断転載を禁じます

広告主に関する開示:このサイトに掲載されている製品の一部は、TechnologyAdvice が報酬を受け取っている企業のものです。この報酬は、製品がこのサイトのどこにどのように表示されるか(表示される順序など)に影響する場合があります。TechnologyAdvice は、市場で入手可能なすべての企業やすべての種類の製品を掲載しているわけではありません。