Re: Mason Migration process
Hiram Gibbard <[email protected]> Mon, 4 Apr 2016 12:00:16 -0500
| Newsgroups | gmane.comp.web.mason.user |
|---|---|
| Message-ID | <CAGTmFdGr_2hB2Thc9H-ssxb+o5z3YUWFWOyJwEF-CKRNfabmNg@mail.gmail.com> |
--===============4347546850896937104==
Content-Type: multipart/alternative; boundary=001a1148eb66b4ca23052faba9fe
--001a1148eb66b4ca23052faba9fe
Content-Type: text/plain; charset=UTF-8
I see. You mean in the Cookie.pm Module?
sub new {
my ($class, $r, %attrs) = @_;
my ($name) = grep {defined} delete $attrs{name} , delete $attrs{-name};
my ($value) = grep {defined} delete $attrs{value}, delete
$attrs{-value};
*return unless defined $name and defined $value;*
my $cookie = $class->make($r->pool, $name, $class->freeze($value));
while(my ($k, $v) = each %attrs) {
$k =~ s/^-//;
$cookie->$k($v);
}
return $cookie;
}
On Mon, Apr 4, 2016 at 11:56 AM, Hiram Gibbard <[email protected]> wrote:
> Thanks. I see what you are saying now. The "value" through me off, because
> its the same name as the var "value". I was just thinking value.
>
> Line 18? Not understanding where you see that line.
>
> On Thu, Mar 31, 2016 at 9:03 PM, Mark Grimes <[email protected]> wrote:
>
>> > Can't call method "bake" on an undefined value at
>> /opt/cloudhost/apache/www/dworks/lib/DWorks/User.pm line 234, <> line 1.
>> >
>> >
>> >
>> > # Currently, we're storing our user state in cookies.
>> >
>> > Apache2::Cookie->new(
>> > $m->apache_req,
>> > name => $name,
>> > value => $value,
>> > expires => ($expires || ''), # Default: when browser is
>> closed.
>> > path => '/',
>> > secure => ($data->{cookie}->{secure} ? 1 : 0),
>> > )->bake;
>>
>> Apache2::Cookie->new() is returning undef instead of an object. Looking
>> at the source, I see it does that when name or value are undefined (line
>> 18). I would check $name and $value.
>>
>
>
>
> --
> Hiram Gibbard
> [email protected]
> http://hiramgibbard.com
>
>
--
Hiram Gibbard
[email protected]
http://hiramgibbard.com
--001a1148eb66b4ca23052faba9fe
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I see. You mean in the Cookie.pm Module?<div><br></div><di=
v><div>sub new {</div><div>=C2=A0 =C2=A0 my ($class, $r, %attrs) =3D @_;</d=
iv><div>=C2=A0 =C2=A0 my ($name) =C2=A0=3D grep {defined} delete $attrs{nam=
e} , delete $attrs{-name};</div><div>=C2=A0 =C2=A0 my ($value) =3D grep {de=
fined} delete $attrs{value}, delete $attrs{-value};</div><div>=C2=A0 =C2=A0=
<b>return unless defined $name and defined $value;</b></div><div><br></div=
><div>=C2=A0 =C2=A0 my $cookie =3D $class->make($r->pool, $name, $cla=
ss->freeze($value));</div><div>=C2=A0 =C2=A0 while(my ($k, $v) =3D each =
%attrs) {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 $k =3D~ s/^-//;</div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $cookie->$k($v);</div><div>=C2=A0 =C2=A0 }</=
div><div>=C2=A0 =C2=A0 return $cookie;</div><div>}</div></div><div><br></di=
v></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Mon, A=
pr 4, 2016 at 11:56 AM, Hiram Gibbard <span dir=3D"ltr"><<a href=3D"mail=
to:[email protected]" target=3D"_blank">[email protected]</a>></span> =
wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Thanks. I see wha=
t you are saying now. The "value" through me off, because its the=
same name as the var "value". I was just thinking value.=C2=A0<d=
iv><br></div><div>Line 18? Not understanding where you see that line.</div>=
</div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Thu, Mar=
31, 2016 at 9:03 PM, Mark Grimes <span dir=3D"ltr"><<a href=3D"mailto:m=
[email protected]" target=3D"_blank">[email protected]</a>></span> wrot=
e:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><p dir=3D"ltr">> Can't call met=
hod "bake" on an undefined value at /opt/cloudhost/apache/www/dwo=
rks/lib/DWorks/User.pm line 234, <> line 1.<br>
><br>
>=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0<br>
><br>
>=C2=A0=C2=A0=C2=A0 # Currently, we're storing our user state in coo=
kies.<br>
><br>
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Apache2::Cookie->ne=
w(<br>
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 $m->apache_req,<br>
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 name=C2=A0=C2=A0=C2=A0 =3D> $name,<br>
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 value=C2=A0=C2=A0 =3D> $value,<br>
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 expires =3D> ($expires || ''), # Default: when browser is cl=
osed.<br>
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 path=C2=A0=C2=A0=C2=A0 =3D> '/',<br>
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 secure=C2=A0 =3D> ($data->{cookie}->{secure} ? 1 : 0),<br>
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )->bake;</p>
<p dir=3D"ltr">Apache2::Cookie->new() is returning undef instead of an o=
bject. Looking at the source, I see it does that when name or value are und=
efined (line 18). I would check $name and $value. <br><span class=3D"HOEnZb=
"><font color=3D"#888888">
</font></span></p><span class=3D"HOEnZb"><font color=3D"#888888">
</font></span></blockquote></div><span class=3D"HOEnZb"><font color=3D"#888=
888"><br><br clear=3D"all"><div><br></div>-- <br><div><div dir=3D"ltr"><div=
>Hiram Gibbard<br><a href=3D"mailto:[email protected]" target=3D"_blank">h=
[email protected]</a></div><div><a href=3D"http://hiramgibbard.com" target=
=3D"_blank">http://hiramgibbard.com</a></div><div><br><div style=3D"display=
:inline"></div></div></div></div>
</font></span></div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature"><div dir=3D"ltr"><div>Hiram Gibbard<br><a href=3D"mail=
to:[email protected]" target=3D"_blank">[email protected]</a></div><div><=
a href=3D"http://hiramgibbard.com" target=3D"_blank">http://hiramgibbard.co=
m</a></div><div><br><div style=3D"display:inline"></div></div></div></div>
</div>
--001a1148eb66b4ca23052faba9fe--
--===============4347546850896937104==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
--===============4347546850896937104==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users
--===============4347546850896937104==--