1: Where are cookies stored, client or server? Answer
2: Name two HTTP headers that pertain to cookies. Answer
3: Of the 2 above mentioned http header fields, which is sent by the server and which is sent by the client? Answer
4: What two pieces of information are always included in the Set-Cookie header field: Answer
Set-Cookie: SessionId=1234
5: Optionally, what other information can be included in a Set-Cookie header? Answer
Set-Cookie: SessionId=1234; expires=Wednesday, 09-Nov-99 23:12:40 GMT; domain=www.smart-soft.com; path=/foo; secure
6: Of the 4 cookie fields mentioned above, which 2 effect the scope (or visibility) of the cookie? Answer
7: Are cookies stored on the clients hard drive or in the client RAM? Answer
8: If no "expires" value is set, what is the life-time of the cookie? Answer
9: How does one delete a cookie using the Set-Cookie header? Answer
Set-Cookie: x=10; expires=Wednesday, 09-Nov-99 23:12:40 GMT
10: Name two ways to set a cookie from a servlet: Answer
response.setHeader("Set-Cookie","x=10");
response.addCookie( new Cookie("x","10") );
11: How does one delete a cookie using the Cookie class? Answer