my $self = shift;
 
-  my $cgi            =  $main::cgi;
-  $cgi             ||=  CGI->new('');
-
-  $session_id        =  $cgi->cookie($self->get_session_cookie_name());
+  $session_id        =  $::request->{cgi}->cookie($self->get_session_cookie_name());
   $session_id        =~ s|[^0-9a-f]||g;
 
   $self->{SESSION}   = { };
 
   my $self = shift;
   my $url  = $self->url_for(@_);
 
-  print $::cgi->redirect($url);
+  print $::request->{cgi}->redirect($url);
 }
 
 sub render {
 
 sub action_reload {
   my ($self, %params) = @_;
 
-  print $::cgi->redirect('controller.pl?action=FrameHeader/header');
+  print $::request->{cgi}->redirect('controller.pl?action=FrameHeader/header');
   exit;
 }
 
   my ($self, %params) = @_;
 
   $::lxdebug->level_by_name($::form->{level}, !$::lxdebug->level_by_name($::form->{level}));
-  print $::cgi->redirect('controller.pl?action=FrameHeader/header');
+  print $::request->{cgi}->redirect('controller.pl?action=FrameHeader/header');
   return;
 }
 
 
 
   $self->unrequire_bin_mozilla;
 
-  $::cgi           = CGI->new('');
   $::locale        = Locale->new($::lx_office_conf{system}->{language});
   $::form          = Form->new;
   $::instance_conf = SL::InstanceConfiguration->new;
-  $::request       = { };
+  $::request       = { cgi => CGI->new({}) };
 
   my $session_result = $::auth->restore_session;
   $::auth->create_or_refresh_session;
   } or do {
     if ($EVAL_ERROR ne END_OF_REQUEST) {
       print STDERR $EVAL_ERROR;
-      $::form->{label_error} = $::cgi->pre($EVAL_ERROR);
+      $::form->{label_error} = $::request->{cgi}->pre($EVAL_ERROR);
       eval { show_error('generic/error') };
     }
   };
 
     1;
   } or do {
-    $::form->{label_error} = $::cgi->pre($EVAL_ERROR);
+    $::form->{label_error} = $::request->{cgi}->pre($EVAL_ERROR);
     show_error('generic/error');
   };
 
 
     1;
   } or do {
-    $::form->{label_error} = $::cgi->pre($EVAL_ERROR);
+    $::form->{label_error} = $::request->{cgi}->pre($EVAL_ERROR);
     show_error('generic/error');
   };
 
 
   my $self = shift;
 
   if (@_) {
-    map({ print($main::cgi->hidden("-name" => $_, "-default" => $self->{$_}) . "\n"); } @_);
+    map({ print($::request->{cgi}->hidden("-name" => $_, "-default" => $self->{$_}) . "\n"); } @_);
   } else {
     for (sort keys %$self) {
       next if (($_ eq "header") || (ref($self->{$_}) ne ""));
-      print($main::cgi->hidden("-name" => $_, "-default" => $self->{$_}) . "\n");
+      print($::request->{cgi}->hidden("-name" => $_, "-default" => $self->{$_}) . "\n");
     }
   }
   $main::lxdebug->leave_sub();
   my $self     = shift;
   my %params   = @_;
 
-  my $cgi      = $main::cgi;
-  $cgi       ||= CGI->new('');
+  my $cgi      = $::request->{cgi};
 
   my $session_cookie;
   if (defined $main::auth) {
   my ($self) = @_;
 
   my $db_charset = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
-  my $cgi        = $main::cgi || CGI->new('');
-  my $output     = $cgi->header('-charset' => $db_charset);
+  my $output     = $::request->{cgi}->header('-charset' => $db_charset);
 
   $main::lxdebug->leave_sub();
 
   die "Headers already sent" if $self->{header};
   $self->{header} = 1;
 
-  my $cgi = $main::cgi || CGI->new('');
-  return $cgi->redirect($new_uri);
+  return $::request->{cgi}->redirect($new_uri);
 }
 
 sub set_standard_title {
 
 #======================================================================
 
 use DBI;
-use CGI;
 use Encode;
 use English qw(-no_match_vars);
 use Fcntl;
   $::lxdebug->enter_sub;
   my $session_result = shift;
 
-  $cgi    = $::cgi;
   $form   = $::form;
   $locale = $::locale;
   $auth   = $::auth;
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   $main::auth->assert('general_ledger');
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   $main::auth->assert('general_ledger');
 
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   my ($title, $readonly, $exchangerate, $rows);
   my ($taxincluded, $notes, $department, $customer, $employee, $amount, $project);
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   my ($transdate, $closedto);
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   my ($customer, $department);
   my ($jsscript, $button1, $button2, $onload);
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   $main::auth->assert('dunning_edit');
 
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   ($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) = split(/--/, $form->{ $form->{vc} });
 
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   my @report_params = qw(created_for subject body reference follow_up_date_from follow_up_date_to itime_from itime_to due_only all_users done not_done);
 
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   $form->{title} = $locale->text('Journal');
 
 
   my @columns = qw(
     gldate         transdate        id             reference      description
-    notes          source           debit          debit_accno   
+    notes          source           debit          debit_accno
     credit         credit_accno     debit_tax      debit_tax_accno
     credit_tax     credit_tax_accno projectnumbers balance employee
   );
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   $form->{debit_1}     = 0 if !$form->{"debit_1"};
   $form->{totaldebit}  = 0;
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   my $follow_ups_block;
   if ($form->{id}) {
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   my $numrows = shift;
 
 
   my $form     = $main::form;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   _check_io_auth();
 
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   $main::auth->assert('vendor_invoice_edit');
 
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   $main::auth->assert('invoice_edit');
 
   my %labels = map { $_ => $_ } @{ $form->{ALL_CURRENCIES} };
   $form->{currency}            = $form->{defaultcurrency} unless $form->{currency};
   $form->{show_exchangerate}   = $form->{currency} ne $form->{defaultcurrency};
-  $TMPL_VAR{currencies}        = NTI($::cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
+  $TMPL_VAR{currencies}        = NTI($::request->{cgi}->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
                                                       '-values' => \@values, '-labels' => \%labels)) if scalar @values;
   push @custom_hiddens, "forex";
   push @custom_hiddens, "exchangerate" if $form->{forex};
 
   $::lxdebug->enter_sub;
   my $session_result = shift;
 
-  $cgi    = $::cgi;
   $form   = $::form;
   $auth   = $::auth;
 
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   check_oe_access();
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   check_oe_access();
 
 
   }
 
   my $projectnumber =
-    NTI($main::cgi->popup_menu('-name' => "project_id",
+    NTI($::request->{cgi}->popup_menu('-name' => "project_id",
                                '-values' => \@project_values,
                                '-labels' => \%project_labels));
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   my $report = SL::ReportGenerator->new(\%myconfig, $form);
 
 
 
   my $form   = $main::form;
   my $locale = $main::locale;
-  my $cgi    = $main::cgi;
+  my $cgi    = $::request->{cgi};
   my $vc     = $form->{vc} eq 'customer' ? 'customer' : 'vendor';
 
   $form->{title}     = $vc eq 'customer' ? $::locale->text('List of bank collections') : $locale->text('List of bank transfers');
   my $form     =  $main::form;
   my $myconfig = \%main::myconfig;
   my $locale   =  $main::locale;
-  my $cgi      =  $main::cgi;
+  my $cgi      =  $::request->{cgi};
   my $vc       = $form->{vc} eq 'customer' ? 'customer' : 'vendor';
 
   if (!$myconfig->{company}) {
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
 
   my ($customer, $department);
 
     # Nichts führt, daher diese Zwischenlösung
 
     &check_name('customer', no_select => 1);
-  
+
     # $form->{customer_id} wurde schon von check_name gesetzt
     $form->{customername} = $form->{customer};
   };
 
     if ( $subtotals2{qty} != 0 ) {
       $subtotals2{sellprice} = $subtotals2{sellprice_total} / $subtotals2{qty};
-      $subtotals2{lastcost} = $subtotals2{lastcost_total} / $subtotals2{qty}; 
+      $subtotals2{lastcost} = $subtotals2{lastcost_total} / $subtotals2{qty};
     } else {
       $subtotals2{sellprice} = 0;
       $subtotals2{lastcost} = 0;
 
 
   $::lxdebug       = LXDebug->new(file => $debug_file);
   $::locale        = Locale->new($::lx_office_conf{system}->{language});
-  $::cgi           = CGI->new qw();
   $::form          = Form->new;
   $::auth          = SL::Auth->new;
   $::instance_conf = SL::InstanceConfiguration->new;
-  $::request       = { };
+  $::request       = { cgi => CGI->new({}) };
 
   die 'cannot reach auth db'               unless $::auth->session_tables_present;
 
 
 my %package_names = SL::DB::Helper::Mappings->get_package_names;
 
 our $form;
-our $cgi;
 our $auth;
 our %lx_office_conf;
 
   $::lxdebug      = LXDebug->new();
   $::locale       = Locale->new("de");
   $::form         = new Form;
-  $::cgi          = new CGI('');
   $::auth         = SL::Auth->new();
   $::user         = User->new($login);
   %::myconfig     = $auth->read_user($login);
-  $::request      = { };
+  $::request      = { cgi => CGI->new({}) };
   $form->{script} = 'rose_meta_data.pl';
   $form->{login}  = $login;
 
 
 
   $::lxdebug = LXDebug->new;
   $::locale  = Locale->new($::lx_office_conf{system}->{language});
-  $::cgi     = CGI->new qw();
   $::form    = Form->new;
   $::auth    = SL::Auth->new;
-  $::request = { };
+  $::request = { cgi => CGI->new({}) };
 
   die 'cannot reach auth db'               unless $::auth->session_tables_present;
 
 
 my (@globals, $testcount);
 
 BEGIN {
-  @globals = qw(lxdebug auth myconfig form cgi lx_office_conf locale dispatcher instance_conf request);
+  @globals = qw(lxdebug auth myconfig form lx_office_conf locale dispatcher instance_conf request);
   $testcount = scalar(@Support::Files::testitems);
 }