[Dancer-users] trouble with sessions

David Precious davidp at preshweb.co.uk
Fri Mar 25 11:27:16 CET 2011


On Friday 25 March 2011 03:51:49 Mr. Puneet Kishor wrote:
> Seems like $self->id is not generating a session id.


Ah, looking at Dancer::Session::Abstract, the ID is set when the init method 
gets called; you've overriden the init method in Dancer::Session::SQLite, so 
the init() method in D::S::Abstract won't get called.

I think you need to add something like the following to your init() :

$self->SUPER::init(@_);

That will call init() from D::S::Abstract, which looks like:


sub init {
    my ($self) = @_;
    $self->id(build_id());
}


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