[Dancer-users] trouble with sessions

David Precious davidp at preshweb.co.uk
Fri Mar 25 11:24:36 CET 2011

On Friday 25 March 2011 03:51:49 Mr. Puneet Kishor wrote:
> Seems like $self->id is not generating a session id. So, while I try and
> figure out what is going on, I thought I would switch to the
> factory-provided Dancer::Session::Storable. However, with that I get the
> following error
> {
>    "error" : "Warning caught during route execution: Use of uninitialized
> value $id in concatenation (.) or string at
> /usr/local/lib/perl5/site_perl/5.12.1/Dancer/Session/Storable.pm line
> 57.\n" }
> The offending line is
> 55> sub session_file {
> 56>     my ($id) = @_;
> 57>     return path(setting('session_dir'), "session_$id.stor");
> 58> }
> Hmmmm... once again, no $id.

Interesting.  I'm looking in to this to see if I can reproduce it.

I do notice that my flush() implementation in D::S::Storable uses $self->{id} 
rather than $self->id, which is wrong, so I'll fix that shortly.

From the problems you're having with D::S::SQLite, though, it does seem that 
$self->id is emtpy when your flush() is called.

By the way, are you planning to release Dancer::Session::SQLite to CPAN?  That 
looks like something which would be beneficial to other users.

If you don't have time, I'd be happy to adopt it and release it for you.


Dave P

David Precious <davidp at preshweb.co.uk> (bigpresh)

  "Programming is like sex. One mistake and you have to support 
  it for the rest of your life". (Michael Sinz)

More information about the Dancer-users mailing list