The ServerVariables are a collection of environment variables and request header information. Information relates to the client and the server.
Information available in the ServerVariables includes the server and client IP addresses and the client browser details.
| Variable | Description |
|---|---|
| ALL_HTTP | Returns all of the HTTP headers sent by the client. Always prefixed with HTTP_ and capitalised |
| ALL_RAW | Returns all headers in a raw format |
| APPL_MD_PATH | Returns the meta base path for the application for the ISAPI DLL |
| APPL_PHYSICAL_PATH | Returns the physical path corresponding to the meta base path |
| AUTH_PASSWORD | Returns the value entered in the client’s authentication dialog |
| AUTH_TYPE | This is the authentication method which is used by the server when it validates users as they attempt to access a protected script. |
| AUTH_USER | Returns the raw authenticated user name |
| CERT_COOKIE | Returns the unique ID for the client certificate as a string |
| CERT_FLAGS | bit0 is set to 1 if the client certificate is present and bit1 is set to 1 if the cCertification authority of the client certificate is not valid |
| CERT_ISSUER | Returns the issuer field of the client certificate |
| CERT_KEYSIZE | The number of bits in the Secure Sockets Layer connection key size. For example, 128. |
| CERT_SECRETKEYSIZE | The number of bits in the server certificate private key. For example, 1024. |
| CERT_SERIALNUMBER | Serial number field of the client certificate. |
| CERT_SERVER_ISSUER | Issuer field of the server certificate. |
| CERT_SERVER_SUBJECT | Subject field of the server certificate. |
| CERT_SUBJECT | Subject field of the client certificate. |
| CONTENT_LENGTH | The length of the content as reported by the client. |
| CONTENT_TYPE | The data type of the content. Used with queries that have attached information, such as the HTTP queries POST and PUT. |
| GATEWAY_INTERFACE | The revision of the CGI specification used by the server. Format: CGI/revision. |
| HTTP_ | This is the value stored in the header HeaderName. Any header other than those listed in this table must be prefixed by “HTTP_” in order for the ServerVariables collection to retrieve its value.Note: The server interprets any underscore (_) characters in HeaderName as dashes in the actual header. For example if you specify HTTP_MY_HEADER, the server searches for a header sent as MY-HEADER. |
| HTTPS_KEYSIZE | The number of bits in the Secure Sockets Layer connection key size. For example, 128. |
| HTTPS_SECTRETKEYSIZE | The number of bits in the server certificate private key. For example, 1024. |
| HTTPS_SERVER_ISSUER | Issuer field of the server certificate. |
| HTTPS_SERVER_SUBJECT | Subject field of the server certificate. |
| INSTANCE_ID | This is the ID for the IIS instance in textual format. If the instance ID is 1, it appears as a string. |
| INSTANCE_META_PATH | The metabase path for the instance of IIS that responds to the request. |
| LOCAL_ADDR | The Server Address on which the request came in. Especially useful on a server which is multi-homed, as it provides details as to on which interface the request came in on. |
| LOGON_USER | The Windows account that the user is logged into. |
| PATH_INFO | Extra path information as given by the client. You can access scripts by using their virtual path and the PATH_INFO server variable. If this information comes from a URL it is decoded by the server before it is passed to the CGI script. |
| PATH_TRANSLATED | A translated version of PATH_INFO that takes the path and performs any necessary virtual-to-physical mapping. |
| QUERY_STRING | Query information stored in the string following the question mark (?) in the HTTP request. |
| REMOTE_ADDR | The IP address of the remote host making the request. |
| REMOTE_HOST | The name of the host making the request. If the server does not have this information, it will set REMOTE_ADDR and leave this empty. |
| REMOTE_USER | Returns an unmapped user-name as a string sent in by the user |
| REQUEST_METHOD | The method used to make the request. For HTTP, this is GET, HEAD, POST, and so on. |
| SCRIPT_MAP | Gives the base portion of the URL. |
| SCRIPT_NAME | A virtual path to the script being executed. This is used for self-referencing URLs. |
| SERVER_NAME | The server’s host name, DNS alias, or IP address as it would appear in self-referencing URLs. |
| SERVER_PORT | The port number to which the request was sent. |
| SERVER_PORT_SECURE | A string that contains either 0 or 1. If the request is being handled on the secure port, then this will be 1. Otherwise, it will be 0. |
| SERVER_PROTOCOL | The name and revision of the request information protocol. Format: protocol/revision. |
| SERVER_SOFTWARE | The name and version of the server software answering the request (and running the gateway). Format: name/version. |
| URL | Gives the base portion of the URL. |
| HTTP_ACCEPT | Returns the value of the Accept header. |
| HTTP_ACCEPT_LANGUAGE | A string describing the language to be used for displaying content. |
| HTTP_CONNECTION | ? |
| HTTP_HOST | The name of the Web server. This may or may not be the same as SERVER_NAME depending on the type of name resolution used on the Web server (IP address, host header). |
| HTTP_USER_AGENT | A string describing the browser that sent the request. |
| HTTP_ACCEPT_CHARSET | – |
| HTTP_CACHE_CONTROL | – |
| HTTP_X_FORWARDED_FOR | If the user accesses the Internet via a proxy server, then this will contain the IP address of the proxy server. |
Using Request.ServerVariables
The values of the ServerVariables variables may be obtained by simply assigning
them to a variable. The following example illustrates how to obtain the IP
address of the client computer.
<%
Dim sValue as string
sValue = request.ServerVariables("REMOTE_ADDR")
%>
The full set of names and values may be obtained using the following example:
<%
For Each sValue In Request.ServerVariables
response.write(Request.ServerVariables("sValue"))
Next
%>
Note: information derived from the client headers may not be genuine, for example for years Opera has been able to masquerade as another browser, simply by changing a setting.


