ServerVariables object is part of the Request object. Servervariables (a collection of server environmental variables) are used to retrieve
headers sent by the client, visitor's IP, referral page, or to find out which version of IIS/ASP is running on the host, etc.
Syntax:
Classic ASP Request.ServerVariables(SERVER_VARIABLE)
ASP.NET HttpRequest.ServerVariables(SERVER_VARIABLE)
Parameters:
SERVER_VARIABLE: The name of the server variable to retrieve.
Descriptions:ALL_HTTP
Returns all HTTP headers sent by the client. ALL_HTTP places an HTTP_ prefix before the header name and header name is always
capitalized.
ALL_RAW
Returns all headers in raw form.
APP_POOL_ID
Returns name of the application pool that is running in the IIS worker process that is handling the request.
APPL_MD_PATH
Returns the metabase path of the application.
APPL_PHYSICAL_PATH
Returns the physical path corresponding to the meta base path.
AUTH_PASSWORD
If Basic Authentication is used, returns the value entered in the client's authentication dialog.
AUTH_TYPE
The authentication method server uses to validate users.
AUTH_USER
Similar to REMOTE_USER, returns the raw authenticated user name.
CERT_COOKIE
Returns unique ID for client certificate. Returned as a string, this value can be used as a signature for the whole client certificate.
CERT_FLAGSbit0 is set to 1 if the client certificate is present.
bit1 is set to 1 if the certification authority of the client certificate is not valid and is not in the list of recognized
certification authorities on the server.
CERT_ISSUER
Returns the issuer field of the client certificate.
CERT_KEYSIZE
Number of bits in the Secure Socket Layer (SSL) connection key size.
CERT_SECRETKEYSIZE
Number of bits in the server certificate private key.
CERT_SERIALNUMBER
Returns the 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
Returns subject field of the client certificate.
CERT_LENGTH
Returns the length of the content as sent by the client.
CERT_TYPE
Data type of the content.
GATEWAY_INTERFACE
Revision of the CGI specification used by the server.
HEADER_HeaderName
The value stored in the
HeaderName.
HTTP_ACCEPT
Returns the value of the Accept header, e.g. "image/gif, image/pjpeg, image/x-xbitmap, image/jpeg, application/vnd.ms-excel". The values are
concatenated, and comma(,) separated.
HTTP_ACCEPT_LANGUAGE
A string describing the language to use for displaying content.
HTTP_COOKIE
Returns the cookie string included with the request.
HTTP_HOST
Returns the name of the web server. This may (or may not) be the same as SERVER_NAME depending on type of name resolution being used on the
web server.
HTTP_METHOD
Method used to make the request.
HTTP_REFERER
Returns a string containing the URL of the page that referred the request to the current page.
HTTP_USER_AGENT
Returns a string describing the browser that sent the request.
HTTP_VERSION
Version and the name of the request protocol. Its a raw form of SERVER_PROTOCOL.
HTTPSON if the request came through a secured channel (e.g. SSL.)
OFF if the request came from an insecure channel.
HTTPS_KEYSIZE
Returns number of bits in the SSL connection key size.
HTTPS_SECRETKEYSIZE
Returns number of bits in server certificate private key. (e.g. 1024.)
HTTPS_SERVER_ISSUER
Issuer field of the server certificate.
HTTPS_SERVER_SUBJECT
Returns subject field of the server certificate.
INSTANCE_ID
The ID for the IIS instance in text format.
INSTANCE_META_PATH
The meta base path for the instance of IIS that responds to the request.
LOCAL_ADDR
Returns the server address on which the request came in. On computers with multiple IP addresses bound to a computer, LOCAL_ADDR can be used
to find out which address the request used.
LOGON_USER
Returns the windows account that the user is impersonating (logged in with) while connected to the web server.
To view raw usernames user REMOTE_USER, UNMAPPED_REMOTE_USER, or AUTH_USER.
PATH_INFO
Extra path information as given by the client.
PATH_TRANSLATED
The physical path that maps to the virtual path in PATH_INFO. In other words its 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 followed by the question mark in the HTTP request.
Example: http://www.chapterzero.co.uk/example.aspx?id=10&name=myexample
In this example, id=10&name=myexample is the query
string.
REMOTE_ADDR
Returns the IP address of the remote host that is making the request.
REMOTE_HOST
The name of the host making the request.
REMOTE_PORT
Returns the client port number of the TCP connection.
REMOTE_USER
Returns an unmapped user name string derived from the authorization header sent in by the user before it is mapped to a windows account. Use
LOGON_USER if authentication filter is insalled on your web server.
REQUEST_METHOD
Returns the method used to make the request.
Example: GET, HEAD, POST, ..
SCRIPT_NAME
Returns the virtual path to the script being executed.
SERVER_NAME
Returns the server's host name, DNS alias, or IP address as it would appear in self-referencing URLs.
SERVER_PORT
The server port number to which the request was sent.
SERVER_PORT_SECURE1 Request is handled on a secure port.
0 Request is being handled on an insecure port.
SERVER_PROTOCOL
Returns the name and revision of the request information protocol.
SERVER_SOFTWARE
Returns the name and version of the server software that is answering the requests and running the gateway.
UNENCODED_URL
Returns raw, unencoded URL.
UNMAPPED_REMOTE_USER
Returns the unmapped username string derived from the authorization header. (Same as REMOTE_USER.)
URL
Returns the base protion of URL. (Use HTTP_URL for raw url.)
Links related to this article:Which Version of IIS/ASP is Running?