Beesnest Special Variables
Beesnest stores a lot of data in special variables. Accessing these variables is
through the Request object (IdcRequest::GetRequestVariable). All of these
variables starts with BN_. There are also inner variables that start with
BNI_. Do not use these two prefixes to regular variable names.
GET, POST and Cookies
I store all of the incoming request variables in one collection (map). If you
need to separate it to GET, POST and Cookies variables, you can access the raw
data from the special variables
BN_Query,
BN_Body and
BN_Cookies.
These variables will always be present
- BN_Address - Full address in the web browser
- BN_Alias - The name of the server as it is shown in the web browser
- BN_URL - The request URL
- BN_FullURL - The URL with the GET request variables
- BN_ClinetIP - The client IP Address
- BN_Method - The request method
- BN_Port - The request port
- BN_Protocol - The request protocol
- BN_Version - The protocol version (like: HTTP/1.1)
- BN_Host - Beesnest host name
- BN_RootPath - Beesnest host root path
- BN_AppPath - Beesnest executable path
- BN_Server - The server name and version
Variables of the Login System
The built-in login system also uses BN_ variables. Whenever a user is logged in
BN_Username will hold the user name (also when using DAA login).
If you did not set
Auto-Cookie to
yes in the configuration of the
login system, you should send
BN_UserID and
BN_RndCode back to the
server, with each request to a protected page. If you want to log out, set
BN_Logout to
yes.
You should use these variables just if you are going to rewrite the login page.
- BN_LoginMsg - When the login page is returned, this will hold a user friendly
login message
- BN_Response - The Client Response
- BN_OrigURL - The original requested URL (same as BN_FullURL)
- BN_Realm - RFC 2617 Group of protection
- BN_Nonce RFC 2617 Server nonce
- BN_Cnonce RFC 2617 Client nonce
- BN_Opaque RFC 2617 Server other randomize code
- BN_NC RFC 2617 Nonce Counter
Regular variables
In the same collection, Beesnest stores all the regular request variables that
came from the query line (GET), the request body (POST) and from Cookies.
If you want a complete list of all the variables, use the
IdcRequest:GetRequestVarsNamesList function (from a script).
Request Variables and CGI calls
Beesnest does not support
CGI calls. However, if needed, most if not all of the
CGI environment variables values, can be acquired from the
BN_ variables. I
suppose that some of the script engines will have to use this technique, because
the interpreter will be able to work just with a CGI like calls. Moreover, it is
possible to write a generic CGI script engine, that will just execute arbitrary
CGI program. This engine cannot be a
Storable engine though.