[Dancer-users] trouble with sessions

Mr. Puneet Kishor punk.kish at gmail.com
Fri Mar 25 13:17:14 CET 2011


Hi Dave,

On Mar 25, 2011, at 6:24 AM, David Precious wrote:

> 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.
> 

Yes, I noticed that as well, however, that was not the source of the error for me, at least. I actually changed that to $self->id but the error was the same. Empty $self->id. 


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

Indeed. My sense is that something has changed upstream re. the way the session id is generated. Which is why my DSSQLite has suddenly stopped working.

> 
> 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.
> 

I am going to release it to CPAN. I have just sat on it all this while, but this is a good incentive to fix it and release it. The git repo is at https://github.com/punkish/Dancer--Session--SQLite

> Cheers
> 
> Dave P
> 
> -- 
> David Precious <davidp at preshweb.co.uk> (bigpresh)
> http://www.preshweb.co.uk/
> 
>  "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