[cgiapp] CAP::Session causing errors under FastCGI and Plack?
    Mike Tonks 
    fluffymike at googlemail.com
       
    Thu Apr  5 04:33:40 EDT 2012
    
    
  
Hi Jason,
We are using CAP::Session with Plack in a dev environment (not
production) and haven't seen any issues.  Also under mod_perl and
vanilla cgi all runs fine.  Tested briefly with nginx as a front end
and seems fine too.  We're using ubuntu.  One of the guys has it
running fine on a Mac too.
sub cgiapp_init {
	my $self = shift;
	$self->init_config() or return undef;
	$self->init_log_engine() or return undef;
	my $logger = Log::Log4perl->get_logger('application.init');
	$logger->trace("init");
	# Connect to the database
	$self->dbh_config($self->cfg('db_connect'));
	$self->session_config(
		CGI_SESSION_OPTIONS => [
          	"driver:mysql;serializer:freezethaw;id:uuid",
          	$self->query,
          	{
          		Handle => $self->dbh,
          	},
          	{
          		name => 'AUTH',
          	},
          ],
          DEFAULT_EXPIRY => '+3h',
          COOKIE_PARAMS => {
          	'-name' => 'AUTH',
          	'-secure' => $self->cfg->{UseHTTPS},
          	'-httponly' => 1,
          	'-expires' => '',
          },
          SEND_COOKIE => 1,
 	);
Maybe try a different driver instead of File?
I'd test it using plackup directly to bypass the nginx and rule out
any issues there.
I'd also use Test::WWW::Mechanize::PSGI to create some kind of
check_session.t script that hits your app, logs in, does stuff, etc.
I find with my environment (eclipse) that I can then use the step
through debugger and see exactly what's going on, set breakpoints,
etc.
Hope this helps!
Mike
> Who else is using CAP::Session with FCGI or Plack?  How did you get it to work?  (Running on OS X but I am not sure that makes a difference).
>
> Any help or suggestions most appreciated.  Thank you!
>
> Jason A. Crome / CromeDome
> DEVNET, Inc. - Cutting Edge Property Tax and Appraisal Solutions - http://www.devnetinc.com
> --
> AIM: TheOneCromeDome
> Twitter: http://www.twitter.com/cromedome
> Blog: http://crome-plated.tumblr.com/
> CPAN: http://search.cpan.org/~cromedome/
> github: http://github.com/cromedome
> Bitbucket: https://bitbucket.org/cromedome/
>
>
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
>
    
    
More information about the cgiapp
mailing list