[Catalyst] Storing DateTime in session causes warning

J. Shirley jshirley at gmail.com
Thu Nov 15 15:57:43 GMT 2007


On Nov 15, 2007 6:23 AM, Christopher H. Laco <claco at chrislaco.com> wrote:

> 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. :-)
>
> -=3DChris
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>
>

What version of DateTime::Locale do you guys have?

0.32 had a bug in it that didn't play nice with storable, so make sure you
have the latest.

-J

-- =

J. Shirley :: jshirley at gmail.com :: Killing two stones with one bird...
http://www.toeat.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071115/91fa5=
715/attachment.htm


More information about the Catalyst mailing list