Session and Stateless requests can be processed using CG/PL applications (rather than the code components built into the Server). These CG/PL applications are called Web Applications.
A stateless request addressing a /programName.wcgp or /programName.wcgp/some_url resource makes the Server load the programname.wcgp CG/PL application from the selected Skin. If the application produces any output, it is returned to the client browser, otherwise the 404 Not Found error is returned.
An application can be started by addressing a /auth/programName.wcgp or /auth/programName.wcgp/some_url resource. Such an HTTP request is authenticated first, and the application is executed on behalf of the authenticated Account.
An application can be started by addressing the /sys/programName.wcgp resource. The application is executed in the Server-wide or the Cluster-wide Unnamed Skin environment on behalf of the postmaster Account in the Main Domain. The sysEntry code section of the programName.wcgp file is executed.
Session requests addressing a /programName.wcgp in the Session (/Session/sessionID/) realm makes the Server load the programname.wcgp CG/PL application from the Session Skin. Only the GET, POST, and HEAD HTTP requests are supported. If the application produces any output, it is returned to the client browser, otherwise the 404 Not Found error is returned. The application is executed on behalf of the Account the Session belongs to.
When a CG/PL module is loaded to process an HTTP request, the main module entry is executed.
Web Applications can use CG/PL external-declarations. When a code section (a procedure or a function) declared as external is called, a file with the code section name and the .wcgi extension is loaded from the current Skin. The program code in this file must contain the code section with the specified name and of the proper type (a procedure or a function). The program code in an .wcgi file may contain other code sections as well.
CG/PL Web Applications can use the following built-in procedures and functions.
GetHTTPParameter(name [ ,index ])
GetHTTPBinaryParameter(name [ ,index ])