When using a handler how do I write a log once per rountrip?
<p>Ive written a http handler to plug into our sites that I want to be able to write the </p>

<pre><code>HttpContext.Current.Request.UrlReferrer
</code></pre>

<p>to a table only once per rountrip for basically page logging.</p>

<p>The full code is:</p>

<pre><code>    void context_AcquireRequestState(object sender, EventArgs e)
    {
        //Will avoid the scenario where session has not been instantiated
        //on W3SVC restart
        if (HttpContext.Current.Session != null)
        {

                WebLogging weblogger = new WebLogging();

                if (HttpContext.Current.Session[EnumsAndConstants.Keys.UserId] != null)
                {
                    weblogger.UserId = (int)HttpContext.Current.Session[EnumsAndConstants.Keys.UserId];
                }

                if (HttpContext.Current.Request.UrlReferrer != null)
                {
                    weblogger.UrlReferrer = HttpContext.Current.Request.UrlReferrer.ToString();
                }

                //Will always have a value
                weblogger.RequestType = HttpContext.Current.Request.RequestType;

                statisticsManager.CreateWebLogging(weblogger);

        }

    }
</code></pre>

<p>This seems to write a log for the page and every control per roundtrip as im getting multiple logs.</p>

<p>So how can I modify the code to only happen once per roundtrip.</p>

<p>I have to use a http module for this.</p>
