[Catalyst] Session, DateTime and Storable

Christopher Laco claco at chrislaco.com
Tue Jan 1 19:40:10 GMT 2008


Dave Rolsky wrote:
> On Mon, 31 Dec 2007, Christopher Laco wrote:
> =

>> I've heard mention of this before, but I can't find the thread.
>> I have the latest DateTime, Storable and
>> Catalyst::Plugin::Session/Authentication and I've getting heap of these
>> in my logs:
>>
>>> Use of uninitialized value in subroutine entry at
>>> blib/lib/Storable.pm (autosplit into
>>> blib/lib/auto/Storable/_freeze.al) line 339.
>>
>> This seems to be caused by storaing a DateTime object in the session. If
>> I store a string instead of a DT instance, the warnings go away.
>>
>> Anyone have any ideas on this one?
> =

> It _should_ work. If you filed a bug report with a simple reproduction
> recipe (that just uses DateTime and Storable, not Catalyst), I'm sure it
> would be fixed.
> =

> =

> -dave

I'm not having any luck coming up with tests yet, mostly because I'm
having a hard time tracking down how exactly C::P::Session::Store,
Store::File, Cache::Cache and Cache::FileCache go about their business.

But, I did stumble upon the trigger.

In my case, I have a DBIx::Class resultset from the database with
DateTime columns from InflateColumn::DateTime. These date/times are
inflated without a timezone [because I didn't specify one], so they are
'floating'.

If, at the point I send those times to the Store->for_session part of
the Auth stuff I insert new Datetime->now (UTC not floating), the
warnings go away. If I insert new DateTime->new objects without a
time_zone (floating), the warnings come back.

So, now it's just a matter of reproducing the steps needs to get it to
bitch.

-=3DChris




-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080101/297e=
5a74/signature.pgp


More information about the Catalyst mailing list