[Catalyst] Session question
    Yuval Kogman 
    nothingmuch at woobling.org
       
    Tue Jan  3 22:45:17 CET 2006
    
    
  
On Tue, Jan 03, 2006 at 13:32:01 -0800, Will Smith wrote:
> Hi,
>   I'd like to ask a basic question:
>   I'm using Catalyst::Plugin::Session, Session::Store::File, Sesion::State::Cookie to store some needed client info that can be retrieved everywhere in the app. I followed the instruction:
>   in the app.pm , set the config as: (I use Session::Store::File instead of FastMmap - I think the FastMmap doesnot work well with Windows XP)
>    
>   use Catalyst qw/-Debug FormValidator Session Session::Store::File Session::State::Cookie /;
>   our $VERSION = '0.01';
>   test->config->{session} = {name => 'test',
>      expires => 10000};
>    
>   in the Client controller:
>    
>   sub checklogin : Local {
>     my ( $self, $c ) = @_;
>     
>     my $client= $c->req->param('clientID');
>     push @{ $c->session->{myclient} }, $client;
This treats $c->session->{myclient} as an array reference, and puts
"$client" on the end of it.
	perldoc -f push
	perldoc perldata
	perldoc perlreftut
	perldoc perlref
>     $c->stash->{myclientID} = $c->session->{myclient};
This puts the array ref on the stash
>   the result that I get is a hash ref number: ARRAY(0x28b615c)
This is what you get when you treat an array as a string instead of
an array.
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
-- 
 ()  Yuval Kogman <nothingmuch at woobling.org> 0xEBD27418  perl hacker &
 /\  kung foo master: /me does a karate-chop-flip: neeyah!!!!!!!!!!!!!!
    
    
More information about the Catalyst
mailing list