Folks,

A pol of gee's in advance - this is probably an inane question for ye
olde mod_perl gods but I'll ask it anyway to see if I get struck by the
lightning of enlightenment!

All the e dot gee's that I can find, perldoc and guide pages show
sessions being used with a tied old hash interface - I was wondering if
there is an new style object interface?

Something like:

  my $session;
  if ( exists $jar->{session} ) {
    # restore the session from server storage
    $session_id = $jar->{session}->value();
    $session = Apache::Session::File->open( $session_id, { isnew => 0,
opened => ht_time(time()) } );
    LogFatal "Didn't find session: $session_id" unless $session;

  } else {
    # Create a new session and remember the ID in a cookie
    $session = Apache::Session::File->new( $session_id, { isnew => 1,
newtime => ht_time(time()) } );
    $session_id = $session->{_session_id};
    my $sessionCookie = Apache::Cookie->new( $r,
          -name   => 'session',
          -value  => $session_id,
          -path   => '/',
          -domain => 'www.nowhere.com',
        );
    $sessionCookie->bake();
  }

TIA

Jeff


Reply via email to