[cgiapp] Sessions leaking with FastCGI
Victor Bruno
vicdamone at gmail.com
Wed Jun 15 23:01:00 EDT 2011
I have a webapp in cgiapp (Titatnium) that I I recently made persistent with
fastcgi. I am seeing and hearing of sporadic user reports of sessions
"leaking" to the wrong clients. A user will login and get presented with
the homepage of a different user who is logged in and has a live session. I
have been taking stabs at what could be causing it and deploying possible
fixes, only to get another report of it happening again. This problem only
cropped up when I moved to fastcgi.
I am having a hard time tracking this down. I am using cgiapp::Dispatch,
cgiapp::Plugin::Session.
My dispatch script looks like this, so I should be getting a fresh CGI query
object on every call with the my $cgi = CGI::Fast -> new(), right?
use lib 'lib';
use strict;
use CGI::Application::Dispatch;
use CGI::Fast;
use FCGI::ProcManager;
my($proc_manager) = FCGI::ProcManager -> new({n_processes => 10});
$proc_manager -> pm_manage();
while (my $cgi = CGI::Fast -> new() )
{
$proc_manager -> pm_pre_dispatch();
CGI::Application::Dispatch->dispatch(
args_to_new => {QUERY => $cgi, PARAMS => { cfg_file => 'myApp.cfg'} },
table => ['logout' => {
prefix => '', app => 'myApp', rm => 'logout' },
':inst/:app/:rm/:id1?/:id2?/:id3?/:id4?' => { prefix
=> 'myApp::Controller' },
],
);
$proc_manager -> pm_post_dispatch();
}
Also, I am wondering about my call to session_config. I still have that in
cgiapp_init - does that need to move to prerun in a persistent environment?
Are there other thing I could be missing with what I am trying to do?
Thanks in advance for any assistance!
Victor
More information about the cgiapp
mailing list