Apache-ASP
view release on metacpan or search on metacpan
site/objects.html view on Meta::CPAN
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Response-%3EW0307fe16>$Response->Write($data)</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Session-%3E%7BCa919a318>$Session->{CodePage}</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Session-%3E%7BL2343b3bf>$Session->{LCID}</a>
</font>
</td>
<td valign=top bgcolor=#005196>
<font face="lucida console" size=-1>
<font color=white><b><a href=#%24Request%20Objc3cab62e><font color=white>$Request Object</font></a></b></font>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Session-%3E%7BS1049f4e8>$Session->{SessionID}</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Request-%3E%7BM81641f4a>$Request->{Method}</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Session-%3E%7BTf539b225>$Session->{Timeout} [= $minutes]</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Request-%3E%7BT6acbcf5a>$Request->{TotalBytes}</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Session-%3EAbc5f4cea0>$Session->Abandon()</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Request-%3EBi2e1177cf>$Request->BinaryRead([$length])</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Session-%3ELocc872f91>$Session->Lock() </a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Request-%3ECled50cd44>$Request->ClientCertificate()</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Session-%3EUnc1c1024f>$Session->UnLock()</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Request-%3ECoe6d79e01>$Request->Cookies($name [,$key])</a>
</font>
</td>
</tr>
<tr>
site/objects.html view on Meta::CPAN
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Response-%3E%7B0a525d33>$Response->{ExpiresAbsolute} = $date</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Application7441b337>$Application->SessionCount()</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Response-%3E%7Bf2167225>$Response->{FormFill} = 0|1</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Response-%3E%7Bf284792c>$Response->{IsClientConnected}</a>
</font>
</td>
<td valign=top bgcolor=#005196>
<font face="lucida console" size=-1>
<font color=white><b><a href=#%24Server%20Objeed08cf85><font color=white>$Server Object</font></a></b></font>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Response-%3E%7Bc48a3e9e>$Response->{PICS}</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Server-%3E%7BSc74a89b4a>$Server->{ScriptTimeout} = $seconds</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Response-%3E%7B7098f2f6>$Response->{Status} = $status</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Server-%3ECon7d9785f8>$Server->Config($setting)</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Response-%3EA8c17d8af>$Response->AddHeader($name, $value)</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Server-%3ECre0144679e>$Server->CreateObject($program_id)</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Response-%3EA1b47bb43>$Response->AppendToLog($message)</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Server-%3EExec0fa247a>$Server->Execute($file, @args)</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#%24Response-%3EB202b8013>$Response->BinaryWrite($data)</a>
</font>
</td>
site/objects.html view on Meta::CPAN
<p>
<p>
<a name=%24Session%20Obj517fb3b8></a>
<font face=verdana><font class=title size=+0 color=#555555><b>$Session Object</b></font>
<font face="courier new" size=3><pre>
</pre></font>The $Session object keeps track of user and web client state, in
a persistent manner, making it relatively easy to develop web
applications. The $Session state is stored across HTTP connections,
in database files in the Global or StateDir directories, and will
persist across web server restarts.
<font face="courier new" size=3><pre>
</pre></font>The user session is referenced by a 128 bit / 32 byte MD5 hex hashed cookie,
and can be considered secure from session id guessing, or session hijacking.
When a hacker fails to guess a session, the system times out for a
second, and with 2**128 (3.4e38) keys to guess, a hacker will not be
guessing an id any time soon.
<font face="courier new" size=3><pre>
</pre></font>If an incoming cookie matches a timed out or non-existent session,
a new session is created with the incoming id. If the id matches a
currently active session, the session is tied to it and returned.
This is also similar to the Microsoft ASP implementation.
<font face="courier new" size=3><pre>
</pre></font>The $Session reference is a hash ref, and can be used as such to
store data as in:
<font face="courier new" size=3><pre>
$Session->{count}++; # increment count by one
%{$Session} = (); # clear $Session data
</pre></font>The $Session object state is implemented through MLDBM,
and a user should be aware of the limitations of MLDBM.
Basically, you can read complex structures, but not write
them, directly:
<font face="courier new" size=3><pre>
$data = $Session->{complex}{data}; # Read ok.
$Session->{complex}{data} = $data; # Write NOT ok.
$Session->{complex} = {data => $data}; # Write ok, all at once.
</pre></font>Please see MLDBM for more information on this topic.
$Session can also be used for the following methods and properties:</font>
<p>
<a name=%24Session-%3E%7BCa919a318></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Session->{CodePage}</b></font>
<font face="courier new" size=3><pre>
</pre></font>Not implemented. May never be until someone needs it.</font>
<p>
<a name=%24Session-%3E%7BL2343b3bf></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Session->{LCID}</b></font>
<font face="courier new" size=3><pre>
</pre></font>Not implemented. May never be until someone needs it.</font>
<p>
<a name=%24Session-%3E%7BS1049f4e8></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Session->{SessionID}</b></font>
<font face="courier new" size=3><pre>
</pre></font>SessionID property, returns the id for the current session,
which is exchanged between the client and the server as a cookie.</font>
<p>
<a name=%24Session-%3E%7BTf539b225></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Session->{Timeout} [= $minutes]</b></font>
<font face="courier new" size=3><pre>
</pre></font>Timeout property, if minutes is being assigned, sets this
default timeout for the user session, else returns
the current session timeout.
<font face="courier new" size=3><pre>
</pre></font>If a user session is inactive for the full
timeout, the session is destroyed by the system.
No one can access the session after it times out, and the system
garbage collects it eventually.</font>
<p>
<a name=%24Session-%3EAbc5f4cea0></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Session->Abandon()</b></font>
<font face="courier new" size=3><pre>
</pre></font>The abandon method times out the session immediately. All Session
data is cleared in the process, just as when any session times out.</font>
<p>
<a name=%24Session-%3ELocc872f91></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Session->Lock() </b></font>
<font face="courier new" size=3><pre>
</pre></font>API extension. If you are about to use $Session for many consecutive
reads or writes, you can improve performance by explicitly locking
$Session, and then unlocking, like:
<font face="courier new" size=3><pre>
$Session->Lock();
$Session->{count}++;
$Session->{count}++;
$Session->{count}++;
$Session->UnLock();
</pre></font>This sequence causes $Session to be locked and unlocked only
1 time, instead of the 6 times that it would be locked otherwise,
2 for each increment with one to read and one to write.
<font face="courier new" size=3><pre>
</pre></font>Because of flushing issues with SDBM_File and DB_File databases,
each lock actually ties fresh to the database, so the performance
savings here can be considerable.
<font face="courier new" size=3><pre>
</pre></font>Note that if you have SessionSerialize set, $Session is
already locked for each script invocation automatically, as if
you had called $Session->Lock() in Script_OnStart. Thus you
do not need to worry about $Session locking for performance.
Please read the section on SessionSerialize for more info.</font>
<p>
<a name=%24Session-%3EUnc1c1024f></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Session->UnLock()</b></font>
<font face="courier new" size=3><pre>
</pre></font>API Extension. Unlocks the $Session explicitly. If you do not call this,
$Session will be unlocked automatically at the end of the
script.</font>
<p>
<a name=%24Response%20Ob5268b3d4></a>
<font face=verdana><font class=title size=+0 color=#555555><b>$Response Object</b></font>
<font face="courier new" size=3><pre>
</pre></font>This object manages the output from the ASP Application and the
client web browser. It does not store state information like the
$Session object but does have a wide array of methods to call.</font>
<p>
<a name=%24Response-%3E%7B4a870234></a>
site/objects.html view on Meta::CPAN
<font face="courier new" size=3><pre>
</pre></font>Locks the Application object for the life of the script, or until
UnLock() unlocks it, whichever comes first. When $Application
is locked, this guarantees that data being read and written to it
will not suddenly change on you between the reads and the writes.
<font face="courier new" size=3><pre>
</pre></font>This and the $Session object both lock automatically upon
every read and every write to ensure data integrity. This
lock is useful for concurrent access control purposes.
<font face="courier new" size=3><pre>
</pre></font>Be careful to not be too liberal with this, as you can quickly
create application bottlenecks with its improper use.</font>
<p>
<a name=%24Application2899ee54></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Application->UnLock()</b></font>
<font face="courier new" size=3><pre>
</pre></font>Unlocks the $Application object. If already unlocked, does nothing.</font>
<p>
<a name=%24Applicationaeaabc29></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Application->GetSession($sess_id)</b></font>
<font face="courier new" size=3><pre>
</pre></font>This NON-PORTABLE API extension returns a user $Session given
a session id. This allows one to easily write a session manager if
session ids are stored in $Application during Session_OnStart, with
full access to these sessions for administrative purposes.
<font face="courier new" size=3><pre>
</pre></font>Be careful not to expose full session ids over the net, as they
could be used by a hacker to impersonate another user. So when
creating a session manager, for example, you could create
some other id to reference the SessionID internally, which
would allow you to control the sessions. This kind of application
would best be served under a secure web server.
<font face="courier new" size=3><pre>
</pre></font>The <a href=eg/global_asa_demo.asp>./site/eg/global_asa_demo.asp</a> script makes use of this routine
to display all the data in current user sessions.</font>
<p>
<a name=%24Application7441b337></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Application->SessionCount()</b></font>
<font face="courier new" size=3><pre>
</pre></font>This NON-PORTABLE method returns the current number of active sessions
in the application, and is enabled by the SessionCount configuration setting.
This method is not implemented as part of the original ASP
object model, but is implemented here because it is useful. In particular,
when accessing databases with license requirements, one can monitor usage
effectively through accessing this value.</font>
<p>
<a name=%24Server%20Objeed08cf85></a>
<font face=verdana><font class=title size=+0 color=#555555><b>$Server Object</b></font>
<font face="courier new" size=3><pre>
</pre></font>The server object is that object that handles everything the other
objects do not. The best part of the server object for Win32 users is
the CreateObject method which allows developers to create instances of
ActiveX components, like the ADO component.</font>
<p>
<a name=%24Server-%3E%7BSc74a89b4a></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Server->{ScriptTimeout} = $seconds</b></font>
<font face="courier new" size=3><pre>
</pre></font>Not implemented. May never be. Please see the
Apache Timeout configuration option, normally in httpd.conf.</font>
<p>
<a name=%24Server-%3ECon7d9785f8></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Server->Config($setting)</b></font>
<font face="courier new" size=3><pre>
</pre></font>API extension. Allows a developer to read the <a href=config.html><font size=-1 face=verdana><b>CONFIG</b></font></a>
settings, like Global, GlobalPackage, StateDir, etc.
Currently implemented as a wrapper around
<font face="courier new" size=3><pre>
Apache->dir_config($setting)
</pre></font>May also be invoked as $Server->Config(), which will
return a hash ref of all the PerlSetVar settings.</font>
<p>
<a name=%24Server-%3ECre0144679e></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Server->CreateObject($program_id)</b></font>
<font face="courier new" size=3><pre>
</pre></font>Allows use of ActiveX objects on Win32. This routine returns
a reference to an Win32::OLE object upon success, and nothing upon
failure. It is through this mechanism that a developer can
utilize ADO. The equivalent syntax in VBScript is
<font face="courier new" size=3><pre>
Set object = Server.CreateObject(program_id)
</pre></font>For further information, try 'perldoc Win32::OLE' from your
favorite command line.</font>
<p>
<a name=%24Server-%3EExec0fa247a></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Server->Execute($file, @args)</b></font>
<font face="courier new" size=3><pre>
</pre></font>New method from ASP 3.0, this does the same thing as
<font face="courier new" size=3><pre>
$Response->Include($file, @args)
</pre></font>and internally is just a wrapper for such. Seems like we
had this important functionality before the IIS/ASP camp!</font>
<p>
<a name=%24Server-%3EFileaa99842></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Server->File()</b></font>
<font face="courier new" size=3><pre>
</pre></font>Returns the absolute file path to current executing script.
Same as Apache->request->filename when running under <a href=http://perl.apache.org><font size=-1 face=verdana><b>mod_perl</b></font></a>.
<font face="courier new" size=3><pre>
</pre></font>ASP API extension.</font>
<p>
<a name=%24Server-%3EGetb3d1ac42></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Server->GetLastError()</b></font>
<font face="courier new" size=3><pre>
</pre></font>Not implemented, will likely not ever be because this is dependent
on how IIS handles errors and is not relevant in Apache.</font>
<p>
<a name=%24Server-%3EHTMb165f10b></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Server->HTMLEncode( $string || \$string )</b></font>
<font face="courier new" size=3><pre>
</pre></font>Returns an HTML escapes version of $string. &, ", >, <, are each
escapes with their HTML equivalents. Strings encoded in this nature
should be raw text displayed to an end user, as HTML tags become
escaped with this method.
( run in 0.721 second using v1.01-cache-2.11-cpan-39bf76dae61 )