You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by Kirk <ki...@icapsolutions.com> on 2007/01/04 21:05:15 UTC

pass mod_perl PerlInitHandler session variable to asp global.asa

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@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org