MANAGED SERVICES RESOURCE WEB SITE  
  MOREnet logo
Home | E-mail Services | Web Site Management | Managed CMS | Managed LMS | SecondWeb | SSL Certificates | Manager Application |
 Home >  Web Site Management >  Apache Web Server Resources >  User Cookie Logging
     
Apache Web
Server Resources
 
     
  Apache Web Server  
  Custom Headers/Footers  
  Server Side Include (SSI)  
  Web Access Controller  
  User Cookie Logging  
     

View the printer friendly version of this document

Enabling User Cookie Logging For Your Web Site

Revised: August 01, 2011


Overview

Web servers for MOREnet hosted web sites now have the ability to automatically generate user cookies with a unique id for each visitor. This information is then saved in the apache logs and reports can be generated by web server log analysis software.


Requesting User Cookie Logging

Your organization's designated contact can call MOREnet's Technical Support to request that user cookie logging be enabled for your MOREnet-hosted web site.

The designated contact will also need to supply the name and domain of your web site, as well as an optional unique name to be used for the cookie. The name to be used for the cookie should be short, generally 3-8 characters in length.

Technical Support will create a support ticket for your request. Your designated contact while then be contacted when user cookie logging has been enabled for your site.


How Will This Affect Web Site Visitors?

Web site visitors who have their browser set to accept cookies will not notice anything different when visiting your web site. Visitors who have set their browser to not accept cookies, will not notice anything different as well.

Visitors who have their browser set to prompt them before accepting cookies will typically receive a pop-up window, generated by their browser, alerting them to the cookie and prompting them to accept or not accept setting the cookie.


What Information is Being Stored in the Cookie?

The only information being stored in the cookie generated by the web server is the IP address of the visitor from the first time they visited the web site, plus a randomly generated number. Together these form a unique identifier for that visitor.


Where is the Information Being Stored?

The user cookie itself is stored by the visitor's browser.

The web server stores the cookie's name and a copy of the cookie in the apache logs for each request the visitor's web browser makes. The apache logs can be found in the ./logs folder for your web site, and can be downloaded via ftp.


What Will the Cookies Look Like in the Logs?

Here is an example of a line from an apache log file with user cookie logging enabled. Normally this would be one single line in the log file, but it is on multiple lines here for readability.

150.199.255.255 - - [03/Mar/2004:13:50:29 -0600]
"GET /howto/stepone.html HTTP/1.1" 200 2265
"http://some.site.org/howto/"
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007"
"minbari-track=207.160.255.255.1077047398242552"

The logged user cookie is the last line of the above example. The first part, "minbari-track", is the cookie's name. "Minbari" here is only for the example; the real cookies name would be the cookie name you specified for your web site with "-track" appended to it. The portion after the equals sign is the unique value of the cookie itself.

The format of the cookie, as listed in the logs, will be similar to the following example:

minbari-track=207.160.255.255.1077047398242552
  • 'minbari-track' - is the CookieName.
  • '207.160.255.255' - is the IP address of the visitor when the cookie was set.
  • '1077047398242552' - a randomly generated number, created by the web server, for this visitor.

You may notice that the IP address for the visitor as listed in the example log line above is different than the IP address in the cookie. The IP portion of the cookie is set from the visitor's IP address at the time their browser first accepted the cookie. The current IP address of some visitors may change over time for various reasons. Usage of DHCP, dial-up, or wireless connections often result in different IP addresses being allocated to a visitor. Regardless, the visitor's browser will maintain the same cookie, allowing the visitor to be logged.


Analyzing the Apache Logs with User Cookie Logging

First, you will need the logs from your web site. Using ftp, download the log files for your web site. On MOREnet managed servers, the current week's log file and the previous 5 weeks' log files are not bzipped. Log files older than 5 weeks are bzipped.

Note that on a Windows system, you will need a utility which recognizes .bz2 files to unzip files older than 5 weeks. One such utility to do this is RedHat's free bzip2 utility for Windows - http://sources.redhat.com/bzip2/.

There are a variety of utilities usable for analyzing apache web logs. Some are oriented toward the sites activity as a whole and will report on most visited pages, busiest hour(s), most downloaded files, and etc.

Utilities which are oriented toward building reports based on cookie information from the web logs are often referred to as "clickstream" log analyzers.

There are a large number of such utilities. Searching the web on "clickstream log analyzer" will give results for many of them. Below is a listing of three sites which list a variety of available log analyzing utilities.