previous | start | next

Cookies

Cookies are an extension to HTTP, originally developed at Netscape. In general, a server "sets" a cookie by sending an additional response header, thus (eg)
HTTP/1.0 200 OK
Set-cookie: myname=myvalue
....etc...
A browser which is "cookie-enabled" will normally[1] store this name/value pair, and future requests to the same server will contain an additional request header, thus:
GET /somefile.html HTTP/1.0
Cookie: myname=myvalue
....etc...
Cookies are extensively used in Web session management, which is discussed later in the unit.
 
[1] In fact, cookie operation is rather more complex than we discuss here -- for example, the "Set-cookie: " header can take several additional parameters (which affect how the cookie is interpreted), and the behaviour of browsers with respect to cookies can be changed by the end-user.
Lecture 06: Applications #3.2: HTTP Copyright © 2005 P.Scott, La Trobe University Bendigo.


previous | start | next