> How do I access the $session object from other subs?

When I use it in my sites, I just pass object as an argument 
to other subs ( I don't use CGI::Application)

        print default($cgi, $session);

But since you are using CGI::Application, it provides
handy param() method. So when you create the session object once, 
you just assign it to CGI::Application's parameter:
        
        $session = new CGI::Session::File(...) or die 
$CGI::Session::errstr;
        $self->param("session-obj", $session);

Note that $self is reference to CGI::Application available from inside 
your cgiapp_init() method. Then in your other subs you will do:

sub foo_bar {
        my $self = shift;
        my $session = $self->param("session-obj");
        ....
}

DO NOT confuse CGI::Application's param() method with CGI::Session's 
param() 
method. 

Good luck

P.S. I am working on a CGI::Session  demo right now, and should be 
available sometime
tonight. 




---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.vm.com/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to