httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
Subject Re: Apache2::Cookie::Jar->cookies($key) doesn't work anymore?
Date Wed, 25 May 2005 16:40:04 GMT
Pete Houston <ph1@openstrike.co.uk> 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


Mime
View raw message