Apache2::Cookie and cookie names

Apache2::Cookie and cookie names

am 19.05.2011 17:27:26 von James.B.Muir

--_000_527C4914F1B2EA47B38422DE0FA05A650651548E1ADH201DHMCMa st_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi All,

In a modperl2 handler, using Apache2::Cookie, I have code as follows to fet=
ch the names of the requests cookies:

my @cookie_names =3D (eval { $cookie_jar->cookies() });
if ($@) { _oops("Could not parse cookies blah blah."); }

I understand that with this code I either get all of the cookie names if th=
ey all can be parsed, or I get none of the cookie names if a parsing except=
ion is thrown.

Is there a way to get the names of all of the cookies that could be parsed =
up until the exception was thrown? I've seen in other postings this nifty e=
xample for getting the cookie jar:

my $cookie_jar =3D eval { Apache2::Cookie::Jar->new($r) } || $@->jar;

I'm wondering if there might be something as succinct and elegant as this f=
or getting the cookie names.
-James



IMPORTANT NOTICE REGARDING THIS ELECTRONIC MESSAGE:

This message is intended for the use of the person to whom it is addressed =
and may contain information that is privileged, confidential, and protected=
from disclosure under applicable law. If you are not the intended recipien=
t, your use of this message for any purpose is strictly prohibited. If you =
have received this communication in error, please delete the message and no=
tify the sender so that we may correct our records.

--_000_527C4914F1B2EA47B38422DE0FA05A650651548E1ADH201DHMCMa st_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">

>





Hi All,


 


In a modperl2 handler, using Apache2::Cookie, I have=
code as follows to fetch the names of the requests cookies:


 


my @cookie_names =3D (eval { $cookie_jar->cookies=
() });


if ($@) { _oops(“Could not parse cookies blah =
blah.”); }


 


I understand that with this code I either get all of=
the cookie names if they all can be parsed, or I get none of the cookie na=
mes if a parsing exception is thrown.


 


Is there a way to get the names of all of the cookie=
s that could be parsed up until the exception was thrown? I’ve seen i=
n other postings this nifty example for getting the cookie jar:<=
/p>

 


my $cookie_jar =3D eval { Apache2::Cookie::Jar->n=
ew($r) } || $@->jar;


 


I’m wondering if there might be something as s=
uccinct and elegant as this for getting the cookie names.


-James


 


 





IMPORTANT NOTICE REGARDIN=
G THIS ELECTRONIC MESSAGE:



This message is intended for the use of the person to whom it is addressed =
and may contain information that is privileged, confidential, and protected=
from disclosure under applicable law. If you are not the intended recipien=
t, your use of this message for
any purpose is strictly prohibited. If you have received this communicatio=
n in error, please delete the message and notify the sender so that we may =
correct our records.





--_000_527C4914F1B2EA47B38422DE0FA05A650651548E1ADH201DHMCMa st_--