Loading ...
Sorry, an error occurred while loading the content.

pass mod_perl PerlInitHandler session variable to asp global.asa

Expand Messages
  • Kirk
    Like the title says, I m wondering how to pass a tied session handle (via PerlInitHandler My::StateInit) to the ASP global.asa file. I m using
    Message 1 of 1 , Jan 4, 2007
    • 0 Attachment
      Like the title says, I'm wondering how to pass a tied session handle (via
      PerlInitHandler My::StateInit) to the ASP global.asa file. I'm using
      Apache::Session::MySQL to look for incoming cookies, set the session_id if
      not found, then pass the $session handle to the database to the default
      global.asa file. Just now sure how to do that, anyone?

      ###############################
      package My::StateInit;

      use strict;
      use Apache::Session::MySQL;

      sub handler() {
      my $r = shift;
      my $cookie = $r->header_in('Cookie');
      my $dbh = $DB->getHandle();

      my %session;
      eval {
      tie %session, 'Apache::Session::MySQL', $cookie, {
      Handle => $dbh,
      LockHandle => $dbh
      };
      };
      if ($@)
      {
      tie %session, 'Apache::Session::MySQL', undef, {
      Handle => $dbh,
      LockHandle => $dbh
      };

      }

      #### I want to pass %session to global.asa file ???
      $r->pnotes(SESSION) = \%session; # ???
      return OK;

      }
      1;
      ##############






      K






      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    Your message has been successfully submitted and would be delivered to recipients shortly.