[Catalyst] Storing DateTime in session causes warning

Christopher H. Laco claco at chrislaco.com
Thu Nov 15 14:23:36 GMT 2007

Tobias Kremer wrote:
> I'm storing a DateTime object in $c->session and I just realized that this
> is causing the following warning on every request:
> =

> "Use of uninitialized value in subroutine entry at ../../lib/Storable.pm
> (autosplit into ../../lib/auto/Storable/_freeze.al) line 290."
> =

> The following reproduces the error for me:
> =

> $c->session->{ 'mydate' } =3D DateTime->new( year =3D> 2007 );
> =

> (for instance in the auto method of the Root controller)
> =

> Can somebody confirm this? Any ideas on what's going on and how to fix it?
> =

> --Tobias

I have the exact same issue. I'm storing my user/roles object data hash
in session, and get the same warning all over the place. Annoying as hell.

Indeed, if I swap out the DateTime objects for strings before stuffing
then in the session, the warnings go away.

So yes, I see it too. :-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071115/c7b0=

More information about the Catalyst mailing list