Modify the source for the CGI script (in cookie.c) to add an expires attribute to the set-cookie header line, such as: Mon, 09-Dec-2002 13:46:00 GMTso that the cookies will be written to a file (instead of existing temporarily during the lifetime of a browser session.) Open two browser sessions on your computer. Browse to form.html in the cookie folder in both sessions, but enter different data (for example: name = “alpha” in one and name = “beta” in the other) in each. Note that this experiment is a repetition of step a in the last exercise, except that the cookies are now written to files. What are the respective settings of the path, and domain attributes of the cookie generated in each session? In each session, which cookie(s) will the browser send to cookie2.cgi via the server? What
This exercise experiments with the cookie example presented in Figures … to investigate the use of the expire attributes with cookies.
The code modification is as follows:
```
for (x=0; x<=m; x++)
{
printf("Set-cookie: %s=%s; expires=Sunday, 01-Dec-2002 23:12:40 GMT
",
entries[x].name, entries[x].val);
}
/*
printf(
"Set-cookie: xxx=1234; expires=Sunday, 01-Dec-2002 23:12:40 GMT
");
*/
```
This change has the effect of forcing the cookies generated by cookie.cgi to be written to files on the client side. In the first browse session where cookie.cgi in the cookie1 directory was invoked, a cookie is generated bearing name = alpha , with the domain attribute set to www.csc.calpoly.edu and the path attribute set to ~mliu/cookie1. In the second browse session, where cookie.cgi in the cookie2 directory was invoked, a cookie is generated bearing name = beta , with the domain attribute set to www.csc.calpoly.edu and the path attribute set to ~mliu/cookie2. As a result, cookie2.cgi in the first browser session receives the cookie name = alpha, whose path attribute tail-matches the script’s path. Likewise, cookie2.cgi in the second browser session receives the cookie name = beta, whose
You might also like to view...
The __________ method can be used to place a new item at any position in a ListBox.
a. Items.New b. Items.Add c. Items.Append d. Items.Insert
After you enter and save contact information, that information is available as you compose ____.
A. shortcuts to Outlook functions, such as Notes B. Outlook management files C. documents D. email messages
As a rule, the color used in toys for boys is usually comprised of _____________.
a. deep, dark colors of blue and violet b. bright, saturated hues of blue and red c. neutrals and shades d. soft, warm hues and pastels
An embedded system is a computer system that is implanted in and dedicated to the control of another device.
Answer the following statement true (T) or false (F)