Permalink
Browse files

provide context for session state class.

  • Loading branch information...
nekokak committed Oct 29, 2009
1 parent f55ecd2 commit 23bd8a2fee23b495d302dc2d359cd1aeddbae612
Showing with 3 additions and 2 deletions.
  1. +1 −0 lib/Kamui/Plugin/Session.pm
  2. +2 −2 lib/Kamui/Plugin/Session/State/Cookie.pm
@@ -53,6 +53,7 @@ sub _setup_state {
my $pkg = $self->{conf}->{state}->{class};
$self->{c}->app->load_class($pkg);
$self->{state} = $pkg->new(
+ c => $self->{c},
req => $self->{c}->req,
%{$self->{conf}->{state}->{option}}
);
@@ -6,7 +6,7 @@ sub new {
my $class = shift;
bless +{
- req => undef,
+ c => undef,
cookie_name => 'kamui_sid',
cookie_domain => '',
cookie_path => '',
@@ -20,7 +20,7 @@ sub new {
sub get_session_id {
my $self = shift;
- my $req = $self->{req};
+ my $req = $self->{c}->req;
if ( my $cookie = $req->cookies->{ $self->{cookie_name} } ) {
my $sid = $cookie->value;

0 comments on commit 23bd8a2

Please sign in to comment.