Question 991109-3: At the web site http://www.frukt.se, people can buy apples, oranges, and bananas. A customer's basket can contain for example 0.5 kilograms apples and 1.4 kilogram bananas. What command, and with which parameters, can such a web site use to store this information in a cookie in the user's workstation?


Solution 1:

HTTP/1.1 200 OK
Set-Cookie: basket="apples=0.5,bananas=1.4"; Version="1";

... Form for ordering more items or ordering the selected items...

Alternative solution:

Set-Cookie: basket.apples="0.5";Version="1", basket.bananas="1.4"; Version="1";

List of exam questions