Apache-ASP

 view release on metacpan or  search on metacpan

site/faq.html  view on Meta::CPAN

	<a name=How%20can%20I%20us65e9eed9></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>How can I use $Session to store complex data structures.</b></font>
<font face="courier new" size=3><pre>
</pre></font>Very carefully.  Please read the $Session documentation in 
the <a href=objects.html><font size=-1 face=verdana><b>OBJECTS</b></font></a> section.  You can store very complex objects
in $Session, but you have to understand the limits, and 
the syntax that must be used to make this happen.
<font face="courier new" size=3><pre>
</pre></font>In particular, stay away from statements that that have 
more than one level of indirection on the left side of
an assignment like:
<font face="courier new" size=3><pre>
  BAD: $Session-&gt;{complex}{object} = $data;
</pre></font>
	
	<p>
	<a name=How%20can%20I%20ke601a6c31></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>How can I keep search engine spiders from killing the session manager?</b></font>
<font face="courier new" size=3><pre>
</pre></font>If you want to disallow session creation for certain non web 
browser user agents, like search engine spiders, you can use a <a href=http://perl.apache.org><font size=-1 face=verdana><b>mod_perl</b></font></a>
PerlInitHandler like this to set configuration variables at runtime:
<font face="courier new" size=3><pre>
 # put the following code into httpd.conf and stop/start apache server
 PerlInitHandler My::InitHandler

 &lt;Perl&gt;

  package My::InitHandler;
  use Apache;

  sub handler {
    my $r = shift; # get the Apache request object

    # if not a Mozilla User Agent, then disable sessions explicitly
    unless($r-&gt;headers_in(&#39;User-Agent&#39;) =~ /^Mozilla/) {
       $r-&gt;dir_config(&#39;AllowSessionState&#39;, &#39;Off&#39;);
    }

    return 200; # return OK mod_perl status code
  }

  1;

 &lt;/Perl&gt;
</pre></font>This will configure your environment before Apache::ASP executes
and sees the configuration settings.  You can use the mod_perl
API in this way to configure Apache::ASP at runtime.
<font face="courier new" size=3><pre>
</pre></font>Note that the Session Manager is very robust on its own, and denial
of service attacks of the types that spiders and other web bots 
normally execute are not likely to affect the Session Manager significantly.</font>
	
	<p>
	<a name=How%20can%20I%20us50054dc6></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>How can I use $Session to store a $dbh database handle ?</b></font>
<font face="courier new" size=3><pre>
</pre></font>You cannot use $Session to store a $dbh handle.  This can 
be awkward for those coming from the IIS/NT world, where
you could store just about anything in $Session, but this
boils down to a difference between threads vs. processes.
<font face="courier new" size=3><pre>
</pre></font>Database handles often have per process file handles open,
which cannot be shared between requests, so though you 
have stored the $dbh data in $Session, all the other 
initializations are not relevant in another httpd process.
<font face="courier new" size=3><pre>
</pre></font>All is not lost! Apache::DBI can be used to cache 
database connections on a per process basis, and will
work for most cases.</font>
	
	<p>
	<a name=Development></a>
	<font face=verdana><font class=title size=+0 color=#555555><b>Development</b></font>
</font>
	
	<p>
	<a name=VBScript%20or%20d51ff480></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>VBScript or JScript supported?</b></font>
<font face="courier new" size=3><pre>
</pre></font>Only Perl scripting is supported with this module.</font>
	
	<p>
	<a name=How%20is%20datab66fe735a></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>How is database connectivity handled?</b></font>
<font face="courier new" size=3><pre>
</pre></font>Database connectivity is handled through perl&#39;s DBI &amp; DBD interfaces.
In the UNIX world, it seems most databases have cross platform support in perl.
You can find the book on DBI programming at <a href=http://www.oreilly.com/catalog/perldbi/>http://www.oreilly.com/catalog/perldbi/</a>
<font face="courier new" size=3><pre>
</pre></font>DBD::ODBC is often your ticket on Win32.  On UNIX, commercial vendors
like OpenLink Software (<a href=http://www.openlinksw.com/>http://www.openlinksw.com/</a>) provide the nuts and 
bolts for ODBC.
<font face="courier new" size=3><pre>
</pre></font>Database connections can be cached per process with Apache::DBI.</font>
	
	<p>
	<a name=What%20is%20the%20ffd599fa></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>What is the best way to debug an ASP application ?</b></font>
<font face="courier new" size=3><pre>
</pre></font>There are lots of perl-ish tricks to make your life developing
and debugging an ASP application easier.  For starters,
you will find some helpful hints by reading the 
$Response-&gt;Debug() API extension, and the Debug
configuration directive.</font>
	
	<p>
	<a name=How%20are%20file3e89fb5c></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>How are file uploads handled?</b></font>
<font face="courier new" size=3><pre>
</pre></font>Please see the <a href=cgi.html><font size=-1 face=verdana><b>CGI</b></font></a> section.  File uploads are implemented
through <a href=http://stein.cshl.org/WWW/software/CGI/cgi_docs.html><font size=-1 face=verdana><b>CGI.pm</b></font></a> which is loaded at runtime only for this purpose.
This is the only time that CGI.pm will be loaded by Apache::ASP,
which implements all other cgi-ish functionality natively.  The
rationale for not implementing file uploads natively is that 
the extra 100K in memory for CGI.pm shouldn&#39;t be a big deal if you 
are working with bulky file uploads.</font>
	
	<p>
	<a name=How%20do%20I%20acc6523fd95></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>How do I access the ASP Objects in general?</b></font>



( run in 1.221 second using v1.01-cache-2.11-cpan-e1769b4cff6 )