Is it possible to access data from an arbitrary $Session object from the
$Application object.  For example, say for each Session opened, I store the
username in $Session->{'user'}.  Can I get a list of all the users currently
connected to the server?  What about arbitrary data currently stored in the
Session object?

In global.asa I have

sub Session_OnStart {
  $Session->{'user'} = Apache->request->connection->user;
  my %session;
  if (ref $Application->{'Session'} eq "HASH") {
     %session = %{$Application->{'Session'}};
  }
  $session{$Session->{'SessionID'}} = $Session;
  $Application->{'Session'} = { %session };
}

sub Session_OnEnd {
  delete $Application->{'Session'}->{'SessionID'};
}


But this only stores the Session hash as it is when the session starts.  So
I only get the user data value.  Any data that gets added to Session after
it starts doesn't show up in $Application->{'Session'}->{'SessionID'}

Is there a way to get a reference to a session object given the SessionID? 
If not, is there any plans on adding that feature?  If not, I'd be happy to
code in that functionality if no one's working on it.

Adi

Reply via email to