Of course you could include a js snippet on every page that checks for a cookie and 
sets it if necessary or just sets it and forgoes the checking. Then on you LogHandler 
read the cookie and insert the proper info into the log if the cookie is set. No 
redirects, no worries about how they got there. Of course they need to access two 
pages on your site - one to initially set the cookie via js and another for you 
LogHandler to read the cookie.

> -----Original Message-----
> From: darren chamberlain [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 27, 2002 9:56 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Apache+Modperl & Website Statistics
> 
> 
> * Philip M. Gollucci <[EMAIL PROTECTED]> 
> [2002-03-27 10:38]:
> > Well I've basically taken your route the first time I tried to
> > do this a year ago.  The other problem is that this requires
> > the vistors go to this particular page.  If they bookmark to
> > another page or type the url of a sublink, this is bypassed,
> > and I loose the statistical information.  My problem is that
> > the PerlLogHandler I've set up isn't actually supposed to ever
> > display anything to the browser.  (I don't think any
> > PerLogHandler anyone writes should send anything to the browser
> > as is basically an extension to use instead of the apache's
> > access_log file.  Although it could if you had a good reason.
> > In order for the javascript I gave to get values it has to be
> > sent to the browser on a page so its processed my the
> > javascript engine in the browsers.
> 
> If you are using a PerlTransHandler anyway, you can have one that
> sends the client to a particular page if a cookie is not set:
> 
>   (a) Client requests /foo.html
>   (b) TransHandler sees that cookie is not set, does an internal
>       redirect to /js-set-cookie.html, which does some (client
>       size) js magic and transparantly redirects to the
>       cookie-setting page, which sets the cookie and does its
>       own redirect.
>   (c) TransHandler gets this request as well (it was an external
>       redirect instigated by the client-side javascript), sees
>       that the cookie it is looking for is set, and does the 
>       appropriate redirecting (to the right sized page).
> 
> Pretty straightforward.  mod_dir does this sort of thing all the
> time, under the covers (although sans javascript, of course).
> 
> (darren)
> 
> -- 
> You can't wake a person who is pretending to be asleep.
>     -- Navajo Proverb
> 

Reply via email to