The cookie hunt: Persistent cookies (cookies whose lifetime extends beyond one session) are stored in short files on the browser user’s computer.
a). Close your browser and restart it to begin a new session.
Run the cookie suite. Enter an unusual name (e.g., “xyxyxyx” in one or both of the form fields. When run, this should create a cookie containing a value that is the quirky string that you entered.
Look for a file that contain your quirky string. Do you find it? If so, does it look like a file that contains the cookie?
(b). In Cookie.c, add an expires attribute to the set-cookie header line, such as:
Mon, 09-Dec-2002 13:46:00 GMT
Run the suite. Look for a file that contain your quirky string. Do you find it? If so, does it look like a file that contains the cookie?
Summarize the experiment and your observations.
The modification to Cookie.c is as follows:
```
/* A Set-cookie header line is generated for each name-value
pair. Each line creates a cookie with default attributes.
*/
for (x=0; x<=m; x++)
{
printf("Set-cookie: %s=%s; expires=Mon,04-Mar-2002 13:46:00 GMT%c\n",
entries[x].name, entries[x].val,'\0');
}
```
Cookie.html is then browsed and the string xxxyyyzzzwww was entered into the name field. This results in a name= xxxyyyzzzwww cookie to be generated by Cookie.cgi, with the expires attribute set to a time in the future. When the browser receives the cookie, it generates a file on the browser’s system, which looks as follows:
xxxyyyzzzwww
www.csc.calpoly.edu/~mliu/cookie/
0
1320868864
29532041
695162768
29474842
*
age
www.csc.calpoly.edu/~mliu/cookie/
0
1320868864
29532041
696162768
29474842
*
id
www.csc.calpoly.edu/~mliu/cookie/
0
1320868864
29532041
696662768
29474842
*
On a Win2000 System where this experiment was held, using file search for the string xxxyyyzzzwww, the file was found in this directory:
C:\Documents and Settings\administrator.HOME.000\Cookies
You might also like to view...
A collection of unprocessed facts and figures, such as student names and Social Security numbers, is known as ________
A) input B) data C) output D) information
In proper database design, you should set the Required field property to Yes for ________ fields
Fill in the blank(s) with correct word