[Catalyst] Duplicate session ids

Bill Moseley moseley at hank.org
Sat May 26 18:00:25 GMT 2007


Perhaps an easier way to show the problem with duplicate created
sessions would help.


If you cut-n-paste the commands below into a bash shell you should see
something like this:

    [debug] Created session "aad42ec88bcfd85dd0c51d38d3b5f207bbca6462"
    [debug] Created session "2bc62f4b3903025c77577e92139964c60d9467bb"



Note: this will create a "Session" directory in the current dir:


catalyst.pl Session >/dev/null

cat << 'EOF' > Session/lib/Session.pm
package Session;
use strict;
use warnings;
use Catalyst::Runtime '5.70';
use Catalyst qw/
    -Debug
    ConfigLoader
    Static::Simple
    Session
    Session::Store::FastMmap
    Session::State::Cookie
/;

__PACKAGE__->config( name => 'Session' );
__PACKAGE__->setup;

sub foo : Local {
    my ( $self, $c ) = @_;
    $c->session->{bar} = 'hello';
    $c->res->body( "in foo\n" );
}

sub finalize_cookies {
    my $c = shift;
    my $x = $c->session->{foo};
    return $c->NEXT::finalize_cookies( @_ );
}
1;
EOF

Session/script/session_test.pl /foo 2>&1 | grep session



I'm running:
    [info] Session powered by Catalyst 5.7007
    | Catalyst::Plugin::ConfigLoader  0.05                                       |
    | Catalyst::Plugin::Session  0.14                                            |
    | Catalyst::Plugin::Session::State::Cookie  0.07                             |
    | Catalyst::Plugin::Session::Store::FastMmap  0.02                           |
    | Catalyst::Plugin::Static::Simple  0.14        

$ perl -MCache::FastMmap -le 'print $Cache::FastMmap::VERSION'
1.16


-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list