Subject: | session + session_cookie enter an infinite loop if you specify an invalid driver |
If you specify an invalid driver CGI::Application::Plugin::Session will
enter into an infinite loop that cycles between session and session_cookie.
This cycle appears to be internal, and is caused here:
$self->{__CAP__SESSION_OBJ} = CGI::Session->new(@params);
If CGI::Session fails to initialize (for example when an invalid driver
is specified) then $self->{__CAP__SESSION_OBJ} will be undefined, which
causes the cycle to start.
Adding a test for defined after the above line would solve this problem.
Example trace from DProf:
CGI::Application::Plugin::Session::session_cookie
CGI::Application::Plugin::Session::session
CGI::Session::new
CGI::Session::load
CGI::Session::parse_dsn
Text::Abbrev::abbrev
CGI::Session::ErrorHandler::set_error
CGI::Session::DESTROY
CGI::Session::flush
CGI::Session::id
CGI::Session::dataref
CGI::Session::dataref
CGI::Session::ErrorHandler::errstr
CGI::Session::ErrorHandler::set_error
CGI::Application::query
CGI::Session::name
CGI::cookie
CGI::self_or_default
CGI::Util::rearrange
CGI::Cookie::fetch
CGI::Cookie::get_raw_cookie
CGI::Application::Plugin::Session::session_cookie
CGI::Application::Plugin::Session::session