--- "Randal L. Schwartz" <[EMAIL PROTECTED]> wrote:
> I was actually looking at a PerlTransHandler that I'd drop into
> my site-wide files that would do something like the following:
> 
>       my $uri = $r->uri;
>       if ($uri =~ s#/@@(\d+)@@/#/#) {
>         $session = $1;
>         $r->uri($uri);
>         $r->header(Session => $session);
>       }
> 
> This way, a session ID could be generated of the form
> 
>       /some/path/@@123456@@/foo/bar.html
> 
> And could be universally included in *any* URL handed to the user,
> but only those things that generate HTML and wish to maintain the 
> session would notice and re-include $session = $r->header(Session) in

> their strings.

A while ago I put together 4-5 rewriterules (mod_rewrite) to automate
passing of user IDs in the URL. This works for static files too and
doesn't require any change to the site. Something like this:

1. if the URI contans @@ID123456@@, then strip it and set enviroment
variable USERID
2. if HTTP_REFERER contains it, then issue an external redirect with
the same URI plus @@ID123456@@. (needed for absolute links)
There was also a rule for images and a special directory (/forgetid)
plus a rule to let other handlers grab the URI too.

My 2 cents

Balazs

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

Reply via email to