Apache2::Cookie and cookie names

--_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 [at] cookie_names =3D (eval { $cookie_jar->cookies() });
if ($ [at] ) { _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) } || $ [at] ->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

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
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">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
[at] font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
[at] font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
..MsoChpDefault
{mso-style-type:export-only;}
[at] page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Hi All,<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">In a modperl2 handler, using Apache2::Cookie, I have=
code as follows to fetch the names of the requests cookies:<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">my [at] cookie_names =3D (eval { $cookie_jar->cookies=
() });<o:p></o:p></p>
<p class=3D"MsoNormal">if ($ [at] ) { _oops(“Could not parse cookies blah =
blah.”); }<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">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.
<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">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:<o:p></o:p><=
/p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">my $cookie_jar =3D eval { Apache2::Cookie::Jar->n=
ew($r) } || $ [at] ->jar;<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">I’m wondering if there might be something as s=
uccinct and elegant as this for getting the cookie names.<o:p></o:p></p>
<p class=3D"MsoNormal">-James<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
</div>
<br>
<font face=3D"Verdana" color=3D"Black" size=3D"1">IMPORTANT NOTICE REGARDIN=
G THIS ELECTRONIC MESSAGE:<br>
<br>
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.<br>
</font>
</body>
</html>

--_000_527C4914F1B2EA47B38422DE0FA05A650651548E1ADH201DHMCMa st_--
James.B.Muir [ Do, 19 Mai 2011 17:27 ] [ ID #2059734 ]
Webserver » gmane.comp.apache.mod-perl » Apache2::Cookie and cookie names

Vorheriges Thema: Deflate problem
Nächstes Thema: Ubuntu and mod_perl