Pete Houston <[EMAIL PROTECTED]> writes:

> At the moment, I'm using this to get at the cookie contents:
>
> %cookies = Apache2::Cookie->fetch($r);
> $value = $cookies{'prefs'}->value;
> if ($value) { %cv = Apache2::Cookie->thaw($value); }
>
> where 'prefs' is the cookie name. This works in 2.05 fine, but I'm not
> convinced that it's 
>
> (a) the most efficient method
> (b) the most elegant method
> (c) the most forward-compatible method
>
> Although Simon's method probably wins on point (b), how do these
> approaches compare for (a) and (c), or is there a better way entirely?

I just implemented Brian's suggestion on cookie_class's
return value, so 2.06 will let you write

  %cv = APR::Request::Apache2 -> handle($r)
                              -> jar
                              -> cookie_class("Apache2::Cookie")
                              -> get('prefs')
                              -> value;

-- 
Joe Schaefer

Reply via email to