Friday, August 29, 2008

What is a Cookie?

What is a Cookie?

A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too. With ASP, you can both create and retrieve cookie values.

The Session object

The Session object

When you are working with an application, you open it, do some changes and then you close it. This is much like a Session. The computer knows who you are. It knows when you start the application and when you end. But on the internet there is one problem: the web server does not know who you are and what you do because the HTTP address doesn't maintain state.

ASP solves this problem by creating a unique cookie for each user. The cookie is sent to the client and it contains information that identifies the user. This interface is called the Session object.

The Session object is used to store information about, or change settings for a user session. Variables stored in the Session object hold information about one single user, and are available to all pages in one application. Common information stored in session variables are name, id, and preferences. The server creates a new Session object for each new user, and destroys the Session object when the session expires.

Wednesday, August 20, 2008

CGI server variables

CGI server variables

The following table describes common CGI environment variables that the server creates (some of these are not available with some servers):

CGI server variable

Description

SERVER_SOFTWARE

Name and version of the information server software answering the request (and running the gateway). Format: name/version.

SERVER_NAME

Server's hostname, DNS alias, or IP address as it appears in self-referencing URLs.

GATEWAY_INTERFACE

CGI specification revision with which this server complies. Format: CGI/revision.

SERVER_PROTOCOL

Name and revision of the information protocol this request came in with. Format: protocol/revision.