2.6 Cookies Spyware
175
displays the current value of document.cookie on the page and creates a cookie named
“test-cookie-1”. Header example:







The first run of the example should display an empty string, the second and
subsequent ones—the string “data = test-cookie-1-data”. The file with this example
is attached to this section; file name - cookie-1.htm.
Sometimes, during creation of a cookie, its storage time is specified using the
parameter expires. This parameter contains the recommended date and time until
which the browser shall store the cookie. The emphasis here is on the word “recommended”: the browser is not obliged to store a cookie during the specified. If
it revealed during creation of a cookie that the date in the parameter “expires” is
earlier than the current date, the cookie with the corresponding name will be deleted.
Moreover, there are so-called session cookies; they have no storage time and exist
only during the session. Session cookies are often used to maintain the user session.
The cookie is sent to the web server in the header of the HTTP request in the Cookie
field.
Typical example of an HTTP request:
GET http://top100-images.rambler.ru/top100/banner-88x31-rambler-black2.gif
HTTP/1.0
Accept: */*
Referrer: http://virusinfo.info
Accept-Language: ru
Proxy-Connection: Keep-Alive
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Host: top100-images.rambler.ru
Pragma: no-cache
Cookie: ruid = yQAAAEBPWkIOagAAAawJAAA=
Detailed specification of cookies in English can be found at http://wp.netscape.
com/newsref/std/cookie_spec.html.
Précédent

- 196/839

Suivant