What is a Web Resource? How Does it Relate to a URL?
In technical terminology, every web address is a resource. This technical definition of resource can be inferred from the use of the term resource in the acronym URI, which stands for Uniform Resource Identifier. A URI identifies the existence of a resource (i.e., an address) on the web. A URL (Uniform Resource Locator) is part of a subset of URIs, which also provide a way to locate the resource - i.e., it provides location information.
What is HTTP? (HyperText Transfer Protocol)
Stated most simply, HTTP is a type of request. More specifically, it specifies how a client machine requests information or actions from servers, or, basically, how two machines share information. The flow of an HTTP request can be visualized as follows:
User issues a command
Client generates a request
Sends it to a Server and waits
Server generates a request
Server sends it to the client via the open connection
Server hangs up
Client renders to the user
What is a Cookie?
HTTP is a stateless protocol: each communication between client and server is discreet and unrelated. But information about states, such as login information, or your amazon cart, can nevertheless be “remembered”, even if you shut down your browser. How does this happen? Through the use of cookies!
The term cookie is used for both the area where web browsers and server applications put information, and the information itself. More specifically, cookies are an area in the sub-directories of a web browser where state information can be stored and accessed. Cookies work in the following way: a server sends some data to the visitor's browser in the form of a cookie. The browser may accept the cookie. If it does, it is stored as a plain text record on the visitor's hard drive. Now, when the visitor arrives at another page on the site, the browser sends the same cookie to the server for retrieval. Once retrieved, the server knows/remembers what was stored earlier. Cookies are a plain text data record of 5 variable-length fields:
Expires: a date, indicating when the cookie will expire. If this field is blank, it expires when you close the browser.
Domain: the domain name of the site.
Path: the path to the directory or web page that set the cookie. This may be blank if you want to retrieve the cookie from any directory or page.
Secure: if this field contains the word “secure”, then the cookie may only be retrieved with a secure server.
Name=Value: cookies are set and retrieved in the form of key/value pairs.
Cookies were originally designed for CGI programming. The data contained in a cookie is automatically transmitted between the web browser and the web server, so CGI scripts on the server can read and write cookie values that are stored on the client. JavaScript can also manipulate cookies using the cookie property of the Document object. JavaScript can read, create, modify, and delete the cookies that apply to the current web page.
There’s obviously much more to learn about the architecture of the web, but I’m going to wrap this post up at this point.