Hi,
I am having problems getting Application variables initialized in the
Application_OnStart
subroutine of global.asa. The Session_OnStart seems to be working fine. I am including
excerpts from httpd.conf, .htaccess, global.asa and the file I'm using to test
global.asa. I
stopped and re-started the server to make sure the application is re-started.
I also tested the global_asa_demo.htm in eg/ directory with a couple of print
statements to
print the $Application->{Count} variable in global.asa of the eg/ directory ... it
didn't
work either.
I would appreciate any pointers with this.
Thanks.
-----
***httpd.conf***
<Directory "/web/htdocs">
#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options FollowSymLinks ExecCGI
#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride AuthConfig
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
****.htaccess***
# .htm files for the ASP parsing, but not the $Session object
# NoState turns off $Session & $Application
<Files ~ (\.htm)>
PerlHandler Apache::ASP
PerlSetVar Debug 2
PerlSetVar Global .
PerlSetVar NoState 0
PerlSetVar BufferingOn 0
PerlSetVar NoCache 1
# PerlSetVar DynamicIncludes 1
</Files>
****global.asa****
sub Application_OnStart {
$Application->{'instance'} = 'global';
}
sub Session_OnStart {
# $Session->Timeout = "300";
$Session->{'test1'} = 'session-own';
$Application->{'test'} = 'my-application';
}
sub Session_OnEnd {
$Session->{"Onlinename"} = "";
$Session->{"UID"} = "";
}
****global_test.htm****
<%
my($xyz)=$Application->{test};
my($abc)=$Application->{instance};
my($uvw) = $Session->{test1};
%>
<html>
<head>
<title>Home Page</title>
</head>
<body LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="5" MARGINHEIGHT="0">
<center>
application variable: <%=$xyz%>
session variable: <%=$uvw%>
application_onstart: <%=$abc%>
</body></html>
-------------------------------------------------------------------------------
Creating Business Communities Instantly http://www.provillage.com