I've been trying to convert our app over to mod_perl.  Everything went
smoothly except the cookies.  When I load the page, some frames load and
other don't.  Below is the Perl function which prints out the headers.  It's
called before any template is printed.  If I comment out the cookie lines,
and print out an empty header the frames load perfectly, albeit without any
session support.  I'm sure this is a big time newbie question, but I'd
appreciate some help... I've been googling around for quite a while.  Thanks
in advance. --Pubert

my $bDidHeader;
my $_cookies={};

#########################################################################################################

sub printHeader {
#########################################################################################################


   my $contentType = shift;

   $contentType = 'text/plain; charset=utf-8' if(!$contentType);

   my $cgi;

   my $sessCookie;

   if(!$bDidHeader) {

       my $objVP = VirtualPlant::getInstance();

       if(! $objVP) {
           use CGI;
           $cgi = new CGI;
           $sessCookie = '';
       } else {
           $cgi = $objVP->Cgi;
           $sessCookie = $cgi->cookie( CGISESSID => $objVP->Session()->id
);
       }

       if($sessCookie) {

           VirtualPlant::Util::setCookie($sessCookie);
             print $cgi->header(
                                -cookie  => values
%{VirtualPlant::Util::getCookies()}
                                );
         }
       $bDidHeader = VirtualPlant::TRUE;
   }
}

Reply via email to